Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does GitHub remember the old origin url after renaming a repository?

Tags:

git

github

I renamed my repository on GitHub via the Web interface but my local repository can still fetch from origin. Why is that so? Does GitHub remember the old url after renaming the repository?

like image 395
Zingam Avatar asked Oct 19 '25 14:10

Zingam


1 Answers

Yes. See https://help.github.com/articles/renaming-a-repository:

In addition to redirecting web traffic, all git clone, git fetch, or git push operations targeting the previous location will continue to function as if made on the new location.

However, GitHub still recommends that contributors do the following:

[...] to reduce confusion, we strongly recommend updating any existing local clones to point to the new repository URL. You can do this by using git remote on the command line:

git remote set-url origin new_url

That's a pretty convenient feature: it gives contributors (to a GitHub repo) all the time in the world to update their local config, instead of letting Git yell at them that the remote (still associated with the old URL in their local config) doesn't exist.

like image 83
jub0bs Avatar answered Oct 21 '25 04:10

jub0bs



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!