- Go to a open source project of your interest and press the fork button
- Press Code button and copy the url
- Now go to your IDE. Here I will use VS Code
git clone "copied url"
- We can see that everything is cloned into the local repository
How to update my local repository
- if other open source contributors make changes, then I will need to update my local repository
- Otherwise there will be a conflict when I ask for pull request
- Go to the original project repository and copy the project url
- Now go to your IDE terminal and type this
git remote add upstream "original project repository url"
# git remote -v shows remote repositories connected to your local repositories
git remote -v
- So it seems like original repository url is already there
- Now we can bring any recent changes made by other contributors
# bring latest updates from 'upstream'
git fetch upstream
# go to the branch you want to update
git checkout master
# merge the latest update and my changes
# git merge remote repository/my branch name
git merge upstream/master
# update my local repository
git push origin master
Make a branch and Contribute
- instead of using master or main branch, it's better to make a branch to show what issue you are trying to solve
git checkout -b "branch name"
git branch "branch name"
git checkout "branch name"
- Commit and push your changes
git add
git commit -m "Add visual studio code for code editor"
git push
- Press Create pull request button and it's all done!
- All you have to do is wait to see if your pull request is approved