I installed Git for Windows, although I am using the shell not the Windows interface.
If I do a git init
, and then try and do a
git remote add origin [email protected]:someuser/testme.git
I get the following error
fatal: remote origin already exists.
So I do a
git remote -v
and it returns the following
origin
upstream
So it appears its there but has no URL set, I don't understand why it's there?
If I do a
git remote rm origin
it produces this
error: Could not remove config section 'remote.origin'
It says that it can't remove the remote.origin config section; I checked the .gitconfig under my home directory and I don't see anything.
Anyway I was able to remedy this by using
git remote set-url origin [email protected]:someuser/testme.git
But I am getting confused as I have used Git before and this never happened.
Could this be something to do with Git for Windows?
git init
will have told you if it re-initialized the repo, in which case nothing is changed. In such a situation, there might naturally be remotes which already existed in the repo – Stepp