Reputation: 4626
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?
Upvotes: 4
Views: 2200
Reputation: 66244
Yes. See https://help.github.com/articles/renaming-a-repository:
In addition to redirecting web traffic, all
git clone
,git fetch
, orgit 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.
Upvotes: 11