How to replace my project’s local repository in Git

Asked

Viewed 693 times

1

I was developing a project in a directory on my computer and put it on github. I had some problems with the project and as I had done few things I decided to start again in another directory.

Using github help, I used the command git remote rm origin to remove the remote URL from the repository, but it didn’t work, I get the following message :

fatal: No such remote: 'URL DO REPOSITÓRIO'

I was confused by the controls. I wanted to change the directory of my computer that feeds the project repository on github, and delete what is currently on it.

1 answer

1


Execute git remote -v to see what has remote.

Now I want to make one thing clear to you: git remote rm ... does not remove from the Github server, it simply removes the remote and its references from local repository.

If you want a new directory, you can simply delete the current location and clone it again somewhere else, now if you have already edits and the like the right one would be to "commit" and do the push remote pro before moving from local directory.

Just to comment, it is possible to have several local directories pointing to the same remote, being on the same machine (your "computer") or different machines.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.