Skip to content

Instantly share code, notes, and snippets.

@bastinc
Last active February 25, 2016 12:36
Show Gist options
  • Save bastinc/fd4f974d9ca1eaefc443 to your computer and use it in GitHub Desktop.
Save bastinc/fd4f974d9ca1eaefc443 to your computer and use it in GitHub Desktop.
Sync a fork repository

Sync the fork

List the current configured remote repository for your fork.

$ git remote -v

Specify a new remote upstream repository that will be synced with the fork.

$ git remote add upstream https://github.com/UMONS-GFA/ardas.git

Fetch the branches and their respective commits from the upstream repository. Commits to master will be stored in a local branch, upstream/master.

$ git fetch upstream

Merge the changes from upstream/master into your local master branch. This brings your fork's master branch into sync with the upstream repository, without losing your local changes.

$ git merge upstream/master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment