Reputation: 287
I am pushing data to github. When I push data i am facing problem.I am pushing data using this.
git init
touch README.md
git add .
git commit -m "initial commit"
git remote add origin https://github.com/YourAccount/firstPush.git
git push -u origin master
Actuall I run git remote add origin https://github.com/YourAccount/firstPush.git
this command wrong.
When I again push data with correct path I got error
fatal: remote origin already exists.
Upvotes: 7
Views: 12828
Reputation: 11
Find the .gitconfig file in your local computer. Open it with notepad and delete the urls from there.
The following command will show you where your url is living.
git config --list --show-origin
Upvotes: 0
Reputation: 80653
You can follow any of the following 3 methods:
Remove the old origin
and readd the correct one:
git remote remove origin
git remote add origin <correct address>
Update the existing remote links:
git remote set-url origin <correct url>
you can optionally provide --push
to the above command.
Update the remote
section of your .git/config
file:
[remote "origin"]
url = <correct url>
fetch = +refs/heads/*:refs/remotes/origin/*
[branch "master"]
remote = origin
merge = refs/heads/master
You can also refer to git documentation for the git remote
commands.
Upvotes: 12