1

I switched from github to bitbucket. Instead of doing the rational thing and just importing the files, I deleted them on github.

Here's the steps I took, but they are not working.

$ git remote add origin [email protected]:RallyWithGalli/personalcontrolcenter.git

fatal: remote origin already exists.

Since it already exists I then moved onto the next step.

$ git push -u origin --all

ERROR: Repository not found. fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists.

I don't know how to fix this error. I'd love to just be able to erase everything in git and start from scratch if that can easily be done.

1 Answer 1

2
$ git remote add origin [email protected]:RallyWithGalli/personalcontrolcenter.git fatal: remote origin already exists. 

What Git is telling you there is a remote named origin already exists, but it doesn't necessarily have the same URL. In your case, it's still pointing at your Github repository. Since you deleted it, when you try to push you get repository not found.

The procedure I would suggest is to rename rather than remove the Github remote (ie. origin). This will preserve the content of the Github repository just in case the move to Bitbucket doesn't go well. Then make Bitbucket your origin and push.

  • git remote rename origin github
  • git remote add origin [email protected]:RallyWithGalli/personalcontrolcenter.git
  • git push origin --all
Sign up to request clarification or add additional context in comments.

3 Comments

What if I already deleted the github repo manually via github?
@AnthonyGalli.com That was what I understood. Git stores everything locally, as well as remotely, so you have a complete copy of your Github repository. That will be retained by keeping the github remote around. Just the commits, not the issues or wiki or other Github stuff. Git only speaks to the remote repository when you push, pull and fetch. Look at your repository with a viewer like gitk or GitX and it will become clearer.
Okay thanks for that explanation. That makes sense now why I was having other git problems :)

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.