Remote 'origin' already exists when it does not
See original GitHub issueDoes this issue occur when all extensions are disabled?: n/a Needs Git extension
- VS Code Version: 1.69.0
- OS Version: Windows 11 - Version 10.0.22000 Build 22000
Steps to Reproduce:
- Initalise a new repository
- Open git repo in sourcecode panel
- Remote -> Add Remote
- use origin as the remote name
- Error Remote āoriginā already exists
- Confirm origin doesnāt exist
git remote get-url --all origin -> error: No such remote 'origin'
- Use terminal to add remote git remote add origin <url>
You can then remove the origin remote using the Remote -> Remove Remote, and then try adding it using the UI and it still fails.
Issue Analytics
- State:
- Created a year ago
- Comments:8 (4 by maintainers)
Top Results From Across the Web
Remote Origin Already Exists Error: How To Fix It | CloudBees
1. Remove the Existing Remote. The first scenario we'll cover is the one in which there's already a remote called origin, but it's...
Read more >How to fix 'fatal: remote origin already exists' Git error - Komodor
fatal : remote origin already exists is a common Git error that occurs when you clone a repository from GitHub, or an external...
Read more >Remote origin already exists on 'git push' to a new repository
Remote origin already exists on 'git push' to a new repository Ā· Give the output of the command $> git remote -v show...
Read more >How to Fix Git Error "Fatal: remote origin already exists" - Datree
The error `fatal: remote origin already exists` is caused when you attempt to create a link to a remote repository called āoriginā when...
Read more >How to Deal with fatal: remote origin already exists Error
Another reason is trying to change the URL of the āoriginā remote repository using the git remote add command. The remote add command...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
The worst part about that was it opening nanoā¦vim till I die.
Ok so yes there is config defined, but this config is required to prune from origin when I fetch. This is another issue with VSCode, it ignores this config and doesnāt prune but that aside (Ill open another ticket for that) this config is needed.
Iād suggest reworking the handling of remotes, and only when there is a URL should you complain about it existing.
@flipkickmedia, thanks for the running the tests and for providing the additional information. Based on the provided data, it does look like VS Code correctly removes the āremoteā section from the repositoryās git config file. Having said that I just checked and if we cannot find any remotes in the repositoryās git config file, we will always fallback to the output of
git remote -v
.I believe that what we have to understand is why
git remote -v
returns a remote even though all remotes have been deleted. The only think that I can think of is that somehow either the system or the global git config has a āoriginā remote defined and that is what is being returns by thegit remote -v
command. Could you please run these commands and see if the config files contain the āoriginā remote:git config --system -e
git config --global -e