Difference between revisions of "Git Tips Tricks"

From WTFwiki
Jump to navigation Jump to search
(Created page with "= 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...")
 
Line 8: Line 8:
 
   git pull https://github.com/upstreamuser/project.git refs/pull/12/head
 
   git pull https://github.com/upstreamuser/project.git refs/pull/12/head
 
   git push origin correctbranchname
 
   git push origin correctbranchname
 +
 +
This clones your forked copy of "project" locally, checks out some relevant branch ("correctbranchname"), then does a combination pull+merge on the upstream project's open PR number 12.

Revision as of 16:23, 5 November 2018

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 forkedversion
 git checkout correctbranchname
 git pull https://github.com/upstreamuser/project.git refs/pull/12/head
 git push origin correctbranchname

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