0

After cloning a repo to local using git clone, I renamed the remote repo on GitHub directly. If I then change the name of the cloned repo locally to match with the new name of the remote repo, can I still connect to the renamed remote repo?

Is there a way to connect the cloned repo with the renamed remote repo by just changing some names so that I don't have to clone it again?

AlexH
  • 3
  • 3

2 Answers2

3

Renaming shouldn't have an impact on the connection between your local and the remote repository.

If you changed the path of your remote repository, you'll have to change that in your local repository as well. You can do this by executing git remote set-url origin {new url}

sgart
  • 76
  • 6
1

Normally, you don't have to care, because github keeps the old name of the repo as a link to the new name, so the remote reference in your local copy will still work for push/pull operations.

But of course you can change the link to the remote repository (or add a new remote). That is one of the main features of a distributed version control system. The command line operation to update remotes is git remote [options].

PMF
  • 14,535
  • 3
  • 23
  • 49