Git Remote Add Upstream – fatal: remote upstream already exists

While attempting to add https://github.com/alanrenouf/vCheck-vSphere as an upstream something went awry and I was constantly presented with the error:

fatal: remote upstream already exists

GitIssue1

OK, but when I tried to fetch the upstream it failed with:

fatal: ‘upstream’ does not appear to be a git repository

GitIssue2

Being new to git this took a little while to figure out, but I thought I’d document it in case it would be helpful for someone else.

Inside a repository you can check your remote repositories configured with:

git remote -v

From which I could see that my fork was correctly configured with a URL, but not the upstream

GitIssue3

This can be corrected with:

git remote set-url upstream https://github.com/alanrenouf/vCheck-vSphere.git

and confirmed with again:

git remote -v

GitIssue4

Subsequently, I was able to fetch the upstream:

git fetch upstream

GitIssue5

6 thoughts on “Git Remote Add Upstream – fatal: remote upstream already exists

  1. Thanks for posting this fix! I’ve been using GitHub for Windows and this seemingly undocumented issue has been annoying the hell out of me.

Comments are closed.