Agung
Agung

Reputation: 13863

remote origin already exists even though i have not been created on command line

I am a newbie in the mobile app development, recently i am following a tutorial which makes remote repository on github named 'Story' ('https://github.com/AgungLaksana/Story.git/), and then i want to repeat what the instructor doing by myself,

i delete the 'story' repository on Github , and i make my own remote repository on github called XYZ, but when i type this line on the command line :

git remote add origin https://github.com/AgungLaksana/XYZ.git

it shows up a fatal error :

fatal: remote origin already exists.

and when i want to push the file in my local machine, i type :

git push

but it shows another error

fatal: repository 'https://github.com/AgungLaksana/Story.git/' not found

what should i do if i want to push to my own remore repository called XYZ ? it seems that the command line attached to my old remote repository

thanks :)

Upvotes: 0

Views: 47

Answers (2)

slashpai
slashpai

Reputation: 1169

Use git remote -v to see all the remotes. Since you changed your repository name in remote you need to update it in ur local too. So delete the origin which points to old remote using git remote rm origin and then create new remote using git remote add origin <correct remote url>

Upvotes: 0

2oppin
2oppin

Reputation: 2001

It seems that you cloned your project from somewhere, you can check your current origin with this:

git remote get-url origin

to replace it on your own you need to type:

git remote set-url origin https://github.com/AgungLaksana/XYZ.git

details you can find in definitive guide in github docs.

Upvotes: 1

Related Questions