SamXiao

Change Git remote repository name

May 28, 2012

We usually initialize Git project by running the git clone command which by default puts the remote name as origin. In many cases, this will work fine but you may need to add a 2nd remote onto the same project and you want your origin to be renamed as something else.

$ git remote rename <old name> <new name>

If you aren’t sure what’s your existing remote name, you can easily find that out by simply running the below command. That will show all of your remote names.

$ git remote -vv
Tags for this post:
  • git
  • comments powered by Disqus