Skip to content

Instantly share code, notes, and snippets.

@nataliepo
Created September 11, 2014 14:07
Show Gist options
  • Save nataliepo/abd716667b6325a66608 to your computer and use it in GitHub Desktop.
Save nataliepo/abd716667b6325a66608 to your computer and use it in GitHub Desktop.
keeping a forked repo up to date
to configure your repo to point to an upstream repo:
1. add this to .git/config:
[remote "upstream"]
url = https://github.com/gitusername/repo-name.git
fetch = +refs/heads/*:refs/remotes/upstream/*
2. fetch the other repo's changes into upstream/master
git fetch upstream
3. check out your local master branch.
git checkout master
4. merge upstream/master -> local master.
git checkout master
git merge upstream/master
then, your master will be up to date with the original repo's master.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment