Welcome! This project is designed to help beginners learn how to make their first contribution to an open-source project. No prior experience is necessary—just follow the steps below, and you'll be on your way to successfully contributing to the open-source community.
Contributing to open-source projects is a great way to learn, teach, and build experience. This guide will take you step-by-step through the process of making your first contribution. Even if you’ve never used Git or GitHub before, you’ll find everything you need here.
Before you start, ensure you have the following:
- A GitHub account: If you don’t have one, sign up here.
- Git installed on your computer: Download it from git-scm.com. If you’re unsure how to install Git, follow this guide.
- A text editor or IDE: Examples include Visual Studio Code, Sublime Text, or Atom.
Fork this repository by clicking on the fork button on the top of this page. This will create a copy of this repository in your account.
Now clone the forked repository to your machine:
- Using HTTPS
git clone "https://GitHub.com/<your-username>/Hello-OpenSource.git"
- Using SSH
git clone "[email protected]:<your-username>/Hello-OpenSource.git"
Note: Replace with your GitHub username.
Change the current working directory to the cloned repo. For example:
cd Hello-OpenSource
Now create a new branch with the below naming convention:
git switch -c add-your-name
For example:
git switch -c add-alvin-dennis
- Edit the
contributors.json
file in the project directory to include your information.
[
......
{
# info of previous user
},
{
"name": "Alvin Dennis",
"department": "Electrical and Electronics",
"github": "https://github.com/alvin-dennis",
"linkedin": "https://in.linkedin.com/in/alvin-dennis-0a70ba163",
"description": "Frontend Web Developer, Bot Developer, UI/UX Designer, Tester"
}
]
NOTE:
make sure to add your info at the end of the file, after the last user's data. Not in the middle or the top of the file.
Now if you go to the project directory and enter the command git status
, you can see the changes.
Add those changes with the git add
command:
git add -A
Now commit those changes using the git commit
command:
git commit -m "Add <your-name> to contributors list"
For example:
git commit -m "Add Alvin Dennis to contributors list"
Push your changes to GitHub using the git push
command:
git push -u origin <your-branch-name>
For example:
git push -u origin add-alvin-dennis
If you enabled two-factor authentication in your GitHub account you won't be able to push via HTTPS using your accounts password. Instead you need to generate a personal access token. This can be done in the application settings of your GitHub account. Using this token as your password should allow you to push to your remote repository via HTTPS. Use your username as usual.
Creating a personal access token
If you go to your repository page on GitHub you will see a compare & pull request
button. Click that button.
And submit the pull request.
Soon the reviewer will merge the branch into main
.