因为项目管理,需要使项目同时能够更新本地repo,和github上的repo。分析了一下git工具本身就支持此操作,而且很容易,只需运行:
git remote set-url origin --push --add https://git.xxxx.com/xxxxxx/xxxxx.git
就可以了。
同时也可以通过.git/config中查看具体信息如下:
[core]
repositoryformatversion = 0
filemode = true
bare = false
logallrefupdates = true
[remote "origin"]
url = https://github.com/hlzy/xxxxx.git
fetch = +refs/heads/*:refs/remotes/origin/*
pushurl = https://git.xxxx.com/xxxxxx/xxxxx.git
[branch "master"]
remote = origin
merge = refs/heads/master
也可以通过如下命令查看
git remote -v
非常方便