kyob

Make Your Fork Track the Original Upstream Repo

Oct 3rd, 2012
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.96 KB | None | 0 0
  1. http://gun.io/blog/how-to-github-fork-branch-and-pull-request/
  2.  
  3. Make Your Fork Track the Original Upstream Repo
  4.  
  5. It's a fork. Hur hur hur.
  6.  
  7.  
  8. This step isn't absolutely necessary, but I find it very useful if you plan on working on this project for anything more than a very quick fix. Use the following commands to add the 'upsteam' (original project location) as a remote branch so that you can get their updates into your branch. Replace the 'upstreamname' and 'projectname' values with that actual user/project name that you're trying to track.
  9.  
  10. git remote add --track master upstream git://github.com/upstreamname/projectname.git
  11. view rawgistfile1.txtThis Gist brought to you by GitHub.
  12. This will add the original project as a remote named 'upstream'. To get the code, type:
  13.  
  14. git fetch upstream
  15. Then, to merge it into your own project, type:
  16.  
  17. git merge upstream/master
  18. Tada! Now you'll have an up-to-date version of the upstream code in your current branch.
Add Comment
Please, Sign In to add comment