How to fix fatal: remote origin already exists Git
Abul KalamDecember 7, 2022
fatal: remote origin already exists.
fatal: remote origin already exists
When you try to add a origin by using:
git remote add origin 'YOUR-ORIGIN-URL'
Most of times it works but sometimes it says
fatal: remote origin already exists.
because the origin was already there and you added multiple times by mistake. So to avoid this problem you need check what origins are there first by using
git remote -v
We will see all origins in your git local repository if you find doubles or single but not working and still same issue then try below solution.
Solution
git remote remove origin
It will remove all origins from your local git repository then you can add origin again using