您的位置:首页 > 其它

[git]设置remote实现多仓库同步

2018-02-07 18:41 357 查看
来源

$git remote -v #查看当前远端仓库
origin  git@git.coding.net:user/project.git (fetch)
origin  git@git.coding.net:user/project.git (push)
github  git@github.com:user/repo.git (fetch)
github  git@github.com:user/repo.git (push)

$git remote add both git@git.coding.net:user/project.git
# 添加一个名为 both 的远端
$git remote set-url --add --push both git@git.coding.net:user/project.git
# 为其添加 push 到 Coding 的 SSH 地址
$git remote set-url --add --push both git@github.com:user/repo.git
# 为其添加 push 到 GitHub 的 SSH 地址


可以替换为https
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: