arch bash cakephp dauth devops drums drupal fosdem foss git golang information age linux lua maemo mail monitoring music n900 netlog openstack php productivity python real life thesis travel uzbl vimeo web2.0


Handling a remote rename/move with Git

I recently had to rename a repo on my Github account. Github has made this very easy but it's just one side of the issue. Obviously you must also update any references to this remote in other clones, otherwise pushes, fetches etc won't work anymore.

You can do this in two ways:

  • open .git/config and modify the url for the remote manually
  • git remote rm origin && git remote add origin git@github.com:$user/$project.git

That's it! All will work fine again.


Very interesting article. Thanks

it works ! thanks dude

Keep up the good work, and post more articles like the one you have posted above.

I know that this post is a bit aged but in case someone does use it as a reference I's like to add a quicker way to change the URL:

git remote set-url $new_url





What is the first name of the guy blogging here?

This comment form is pretty crude. Make sure mandatory fields are entered correctly.
Basic html tags (a,i,b, etc) are allowed, others are sanitized