Skip to content

Instantly share code, notes, and snippets.

@gotomanners
Created August 30, 2012 15:49
Show Gist options
  • Save gotomanners/3531449 to your computer and use it in GitHub Desktop.
Save gotomanners/3531449 to your computer and use it in GitHub Desktop.
Updating Forked Repos
From :: http://bradlyfeeley.com/2008/09/03/update-a-github-fork-from-the-original-repo/
First you need to add a remote branch to your repository that points to the original repo you forked from.
git remote add --track master mleung git://github.com/mleung/feather.git
You will want to replace ‘master’ with the branch you want to track in the remote repo. In most cases this will be master, although you could replace it with edge or any other branch. You should also replace ‘mleung’ is what you the remote will be called.
To verify the remote repository was added run
git remote
You should see the new remote repo, in this case named ‘mleung’, along with any other remote repositories you may have previously added.
Now we can fetch all the changes from mleung’s code base.
git fetch mleung
This will create a new remote branch called ‘mleung/master’. Now we are ready to merge the code from the remote repository.
git merge mleung/master
That’s it. Remember, this process isn’t limited only to the original repository. Feel free to add remote branches for other user’s forks or even from repositories outside Github.
Update ::
instead of doing `git fetch mleung` then `git merge mleung/master`, you can do it in one step with `git pull mleung master`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment