How do I create and/or send a pull request to another repository hosted on GitHub?
相关问题
- How to add working directory to deployment in GitH
- Why does recursive submodule update from github fa
- Extended message for commit via Visual Studio Code
- Emacs shell: save commit message
- Can I organize Git submodules in a flat hierarchy?
相关文章
- 请教Git如何克隆本地库?
- java开发bug问题:GitHub授权登录无法获取授权账号信息?
- Is there a Github markdown language identifier for
- “no implicit conversion of Integer into String” er
- GitHub:Enterprise post-receive hook
- Git Clone Fails: Server Certificate Verification F
- SSIS solution on GIT?
- Is there a version control system abstraction for
To learn how to make a pull request I just followed two separate help pages on Github (linked below as bullet points). The following command line commands are for Part 1. Part 2, the actual pull request, is done entirely on Github's website.
Part 1: fork someone's repo: https://help.github.com/articles/fork-a-repo
git clone->cd dwolla-php->git remote->git fetch
sequence above to clone your fork somewhere in your computer (i.e., "copy/paste" it to, in this case:third_party TimPeterson$
) and sync it with the master repo (Dwolla/dwolla-php)git add->git commit->git push
sequence above to push your changes to the remote repo, i.e., your fork on Github (tim-peterson/dwolla-php)Part 2: make pull-request: https://help.github.com/articles/using-pull-requests
I've started a project to help people making their first GitHub pull request. You can do the hands-on tutorial to make your first PR here
The workflow is simple as
git clone <clone url you copied earlier>
git checkout -b branch-name
git commit
git push origin branch-name
Compare and pull request
buttonIn order to make a pull request you need to do the following steps:
It took me a while to figure this, hope this will help someone.
I followed tim peterson's instructions but I created a local branch for my changes. However, after pushing I was not seeing the new branch in GitHub. The solution was to add -u to the push command:
(In addition of the official "GitHub Help 'Using pull requests' page",
see also "Forking vs. Branching in GitHub", "What is the difference between origin and upstream in GitHub")
Couple tips on pull-requests:
Assuming that you have first forked a repo, here is what you should do in that fork that you own:
master
, where you could be tempted to accumulate and mix several modifications at once.origin/master
(making sure your patch is still working) will update the pull request automagically (no need to click on anything)git remote prune origin
). The GitHub GUI will propose for you to delete your branch in your pull-request page.Note: to write the Pull-Request itself, see "How to write the perfect pull request" (January 2015, GitHub)
March 2016: New PR merge button option: see "Github squash commits from web interface on pull request after review comments?".
The maintainer of the repo can chose to
merge --squash
those PR commits.After a Pull Request
Regarding the last point, since April, 10th 2013, "Redesigned merge button", the branch is deleted for you:
That confirms the best practice of deleting the branch after merging a pull request.
pull-request vs. request-pull
pull request isn't an official "git" term.
Git uses the
request-pull
(!) command to build a request for merging:It "summarizes the changes between two commits to the standard output, and includes the given URL in the generated summary."
Github launches its own version since day one (February 2008), but redesigned that feature in May 2010, stating that:
e-notes for "reposotory" (sic)
<humour>
That (pull request) isn't even defined properly by GitHub!
Fortunately, a true business news organization would know, and there is an e-note in order to replace pull-replace by 'e-note':
So if your reposotory needs a e-note... ask Fox Business. They are in the know.
</humour>
For those of us who have a github.com account, but only get a nasty error message when we type "git" into the command-line, here's how to do it all in your browser :)