Make your first open source contribution
2 min read
Become a part of open-source community by contributing.
To make your first pull request you should know basic knowledge of git and github and you'll need a GitHub account. If you don't have one, you can create it here.
1.) Find the project you want to contribute to
you can use this projects repo for practice.
2.) Fork the repo
By clicking on "fork".
This will make a copy of the whole project under your GitHub profile.
3.) Clone the repo
use the following command in your git bash
git clone https://github.com/"UserName"/projects.git
In place of UserName write your GitHub username in my case my username is chandanck22
Create a new remote for the upstream repo
git remote add upstream https://github.com/chandanck22/projects.git
"Upstream" is a name for the main repo, from where you pull and keep a clone of your fork updated.
Create a new branch
git checkout -b my-branch
This will create a new branch and switch to it.
In place of my-branch you can use any name
Add some code
Now, the time to add some code
After making the changes, you can check the status by running the
git add .
This command will add all the changes to staging area.
Commit your changes
git commit -m "initial commit"
This involves committing them locally to record the snapshot of your repository to the project history.
In place of "initial commit" write reasonable comment
Push the changes to your repo
git push -u origin my-branch
To push to the upstream branch on the remote.
Pushing is the process of moving code from one repository to another one. Often this is used to move code from a local machine to a remote one.
Create a pull request
Go to your GitHub and make the 'compare and pull request'.
If everythings went OK, the owner of the repository will merge your pull request.
You will receive mail once your pull get merged to main branch.