As more and more open source codes start to use github to maintain their code and use pull requests to accept new patches. In this artical I will introduce how to create a github PR(Pull Requests).
For the detils of github PR, please see this page.
- You need to have a github account :)
- Open the project you want to contribute. I will use CKI-project as my example
- Click “Fork” on the right top of the page.
- Then github will create a same project under your account, with the
forked from CKI-project/tests-beaker
- Now clone the project to you localhost. In my example the addr is
https://github.com/liuhangbin/tests-beaker.git, in your side you need to change the
liuhangbinto your own accound id.
- On local host, create a new branch, e.g. “network_fix”, via
git check -b network_fix. Add your fixes in this branch
- After adding fixes or update with your patch, push the changes to upstream via
git push --set-upstream origin network_fix
- Now there will has a notification like: Create a pull request for ‘network_fix’ on GitHub by visiting:
https://github.com/liuhangbin/tests-beaker/pull/new/network_fix. Or you just open your fork page on github, it will show a
Compare & pull requestbutton.
- Open the URL or click
Compare & pull reuest, you will in the page of
Open a pull request. If it’s only one commit, then every thing should be done and just click
Create pull request. Now you have create a PR(Pull Request) to upstream project. If it’s a patch set, you need to fill the patch subject and comments separately.
How to update your fork to upstream version
Just replace your repo addr to upstream repo addr in your .git/config, and git pull the master branch directly. Then comment the upstream repo addr and push the latest code to your repo. This will update your code to upstream version. Another way is like this page said, but I didn’t try it succeed.
Author Hangbin Liu
LastMod 2019-09-23 (c8666b9)