向多个git仓库提交
查看所有远程仓库
为了不用每次输密码,可以先配置ssh key 查看
添加远程仓库
git remote add origin1 git@other:YYYYYYYYYY/AA.git
向新的代码仓库提交
git push -f origin1 master
直接修改.git/config文件也可实现
[core] repositoryformatversion = 0 filemode = false bare = false logallrefupdates = true symlinks = false ignorecase = true [remote "origin"] url = git@default:XXXXXXXX/AA.git fetch = +refs/heads/*:refs/remotes/origin/* [branch "master"] remote = origin merge = refs/heads/master [remote "origin1"] url = git@other:YYYYYYYYYY/AA.git fetch = +refs/heads/*:refs/remotes/origin1/*
修改readme.md
git add . //提交到版本库放入暂存
git commit -m 'change readme' //提交到版本库
git push origin master //提交到远端仓库origin
git push origin1 master //提交到远端仓库origin1
或者使用source tree,选择推送,会出现两个仓库,选择对应的仓库,进行提交