注:[shortName]是简单的别名,比如origin | dev 之类,方便引用操作; [remoteUrl]是远程库地址。
1、查看远程库
// 查看远程库地址
git remote -v
// 查看远程库信息
git remote show [shortName or remoteUrl]
2、修改/添加远程库
// 删除远程库关系
git remote rm [shortName or remoteUrl]
// 添加远程库
git add [shortName] [remoteUrl]
// 或者 更新修改远程仓库
git remote set-url [shortName] [remoteUrl]
3、修改远程别名shortName
// oldName: 旧的别名,shortName: 新的别名
git remote rename [oldName] [shortName]