Generally speaking, as we were using some open-source libraries we will inevitably find that there are some bugs or points that can be improved. And sometimes we even have to develop a brand new feature based on these libraries to satisfy our own needs. Out of respect for sprit of dedication, contributing our code to these opensource libraries is a good way to give back to the community.
When I decided to contribute to a repository, I will first try looking for if there is a contribution guide for it. Such guides usually lied as a section in the README or as a single document named CONTRIBUTING. Only when no guides were found, I will try to open a pull request to this repository on Github.
github.com/gorilla/mux as a sample repository to which I’m going to contribute. Here’s my workflow:
- On github, fork it to my github account as
- Clone the repository to local:
git clone email@example.com:gorilla/mux.git.
- Rename remote
git remote rename origin upstream.
- Add the URL of my forked repo as the
git remote add origin firstname.lastname@example.org/ggicci/mux.git.
- Make some changes and commit:
git commit ....
- Push the commits to my forked repo:
git push origin ....
- On github, open a pull request from