I'm newly at Git. And I tried to create my first repo and push project.
I'm creating step by step to the Create A Repo.
But after I tried to push my project to the empty repo I caught next:
fatal: remote origin already exists
Here is my steps:
touch README.md
git init
git add README.md
git commit -m "first commit"
git remote add origin [email protected]:nazar-art/NewYearGift.git
git push -u origin master
And exactly here I caught this fatal
.
I tried git remote -v
to see content of remote repo. Here is result:
origin https://github.com/nazar-art/NewYearGift.git (fetch)
origin https://github.com/nazar-art/NewYearGift.git (push)
I couldn't figure out what I'm doing wrong and how to fix this issue?
Seems like remote origin is already there somehow and you want to change its uri to another value. You can't add origin since its already there but you can update it. Instead of git remote add
command, you can run:
git remote set-url origin [email protected]:nazar-art/NewYearGift.git
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With