Skip to content

Instantly share code, notes, and snippets.

@marcostolosa
Created January 7, 2019 16:01
Show Gist options
  • Save marcostolosa/c784fdb534dcff5cb14a24c4f6cd7621 to your computer and use it in GitHub Desktop.
Save marcostolosa/c784fdb534dcff5cb14a24c4f6cd7621 to your computer and use it in GitHub Desktop.
How to upgrade a fork with changes from the original?
# How to upgrade a fork with changes from the original?
# Specify a new remote upstream repository that will be synced with the fork.
git remote add upstream https://github.com/ORIGINAL_OWNER/ORIGINAL_REPOSITORY.git
# Verify the new upstream repository you've specified for your fork.
# git remote -v
# origin https://github.com/YOUR_USERNAME/YOUR_FORK.git (fetch)
# origin https://github.com/YOUR_USERNAME/YOUR_FORK.git (push)
# upstream https://github.com/ORIGINAL_OWNER/ORIGINAL_REPOSITORY.git (fetch)
# upstream https://github.com/ORIGINAL_OWNER/ORIGINAL_REPOSITORY.git (push)
# Fetch all the branches from the upstream repository.
git fetch upstream
# Check out the master branch from your local fork.
git checkout master
# Now merge the changes from upstream/master into your local master branch.
git merge upstream/master
# That's all folks!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment