Skip to content

Instantly share code, notes, and snippets.

@sd031
Created February 24, 2021 12:15
Show Gist options
  • Save sd031/9b1d660cefdd98afc6dc812b291de164 to your computer and use it in GitHub Desktop.
Save sd031/9b1d660cefdd98afc6dc812b291de164 to your computer and use it in GitHub Desktop.
git upstream
Open Terminal.
List the current configured remote repository 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)
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)
Did this doc help you?
Privacy policy
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment