运行 git remote add <shortname> <url> 添加一个新的远程 Git 仓库,同时指定一个你可以轻松引用的简写:
$git remoteorigin$git remote add pb https://github.com/paulboone/ticgit$git remote -vorigin https://github.com/schacon/ticgit (fetch)origin https://github.com/schacon/ticgit (push)pb https://github.com/paulboone/ticgit (fetch)pb https://github.com/paulboone/ticgit (push)
现在你可以在命令行中使用字符串 pb 来代替整个 URL。
重命名
$git remote rename pb paul$git remoteoriginpaul
值得注意的是这同样也会修改你的远程分支名字。 那些过去引用 pb/master 的现在会引用paul/master。
如果因为一些原因想要移除一个远程仓库 - 你已经从服务器上搬走了或不再想使用某一个特定的镜像了,又或者某一个贡献者不再贡献了 - 可以使用 git remote rm :
$git remote rm paul$git remoteorigin
原文:http://www.cnblogs.com/mwt0530/p/5133274.html