Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@ashrithr
Last active August 29, 2015 14:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ashrithr/58410481e7db34405f53 to your computer and use it in GitHub Desktop.
Save ashrithr/58410481e7db34405f53 to your computer and use it in GitHub Desktop.
Updating github fork
  1. cd into the forked repository directory that you want to update

     cd repository_dir
    
  2. Add a new remote to point to the original repository

     git remote add upstream git://github.com/author/project.git
    
  3. Pull the new commits from the original repo

     git fetch upstream
    
  4. Merge the upstream commits with the forked local repo

     git merge upstream/master master
    
  5. replay your local work on top of the fetched branch

     git rebase upstream/master
    

(or)

Instead of 3, 4 & 5 steps use git pull --rebase

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment