Setting up the upstream remote
suggest changeIf you cloned a fork (for example an open source project on GitHub) you may not have push access to the upstream repository. Keep origin pointed at your fork, and add another remote for the upstream repository.
First check the remote names:
$ git remote -v
origin https://github.com/myusername/repo.git (fetch)
origin https://github.com/myusername/repo.git (push)
upstream # this line may or may not be here
If upstream is already listed but has no URL, set it:
$ git remote set-url upstream https://github.com/projectusername/repo.git
If the upstream is not there, or if you also want to add a friend/colleague’s fork (currently they do not exist):
$ git remote add upstream https://github.com/projectusername/repo.git
$ git remote add dave https://github.com/dave/repo.git
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents