Git Remote Add Upstream – fatal: remote upstream already exists

While attempting to add as an upstream something went awry and I was constantly presented with the error:

fatal: remote upstream already exists


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

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


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


This can be corrected with:

git remote set-url upstream

and confirmed with again:

git remote -v


Subsequently, I was able to fetch the upstream:

git fetch upstream


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.