命令:
git remote set-url origin URL
命令:
git remote rm origin
git remote add origin URL
(重新设置upstream branch.
git push --set-upstream origin master
)
直接修改.git
文件夹下config
文件
文件内容:
[core]
repositoryformatversion = 0
filemode = false
bare = false
logallrefupdates = true
symlinks = false
ignorecase = true
[branch "master"]
[remote "origin"]
url = http://mozhx:9527/r/test.git
fetch = +refs/heads/*:refs/remotes/origin/*
[remote "origin2"]
url = http://mozhx:9527/r/test2.git
fetch = +refs/heads/*:refs/remotes/origin2/*
branch
是本地分支
romote
是远程仓库
所以可以移除再添加或者直接添加名称不重复的(方法2)
里面的url
是可以直接设置(方法1)