git - Proper way to submit pull request via GitHub (when contributing to open source) -
i've forked , cloned project github, made branch off master make changes. once i've made changes , want submit pull request, , wondering best way it.
(1) submit pull request upstream repo directly off of branch, merge branch master in repo later on
or
(2) merge branch master in repo first, submit pull request upstream repo master?
as rule of thumb, should not develop on master branch. although technically can, master branch used track current state of project. since pull request not accepted yet, not reflect current state, , merging local master cause confusion. best practice this:
- fork project
- create local feature branch (e.g.,
git checkout -b myfeature
) - develop, test , validate locally.
- push local feature branch remote branch on github account (e.g.,
git push origin myfeature
). - create pull request feature branch (
yourname/myfeature
) master branch (projectowner/master
). - get reviewed, fix pull request needed
- project maintainer merges pull request
- update own local master merged patch (e.g.,
git fetch upstream && git rebase upstream/master
).
Comments
Post a Comment