Git Tips Tricks

From WTFwiki
Revision as of 18:28, 5 November 2018 by Jontow (talk | contribs) (add link to old piscisaureus github pr gist)
Jump to navigation Jump to search

Github specific

Github and Pull Requests

Common scenario to run into: you've forked some repo and (or because!) there are outstanding Pull Requests (PRs) created on the upstream project that you want merged into the codebase. This turns out to be relatively easy:

 git clone git@github/com:youruser/project.git
 cd project
 git checkout correctbranchname
 git pull refs/pull/12/head
 git push origin correctbranchname

This clones your forked copy of "project" locally, checks out whatever branch the PR is against ("correctbranchname"), then does a combination pull+merge on the upstream project's open PR number 12.

See also, a useful discussion about command line access to pull requests: