通过Github,Sourceforge和Google Code镜像存储库 [英] Mirroring a repository across Github, Sourceforge and Google Code
本文介绍了通过Github,Sourceforge和Google Code镜像存储库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
是否有可能在GitHub,SourceForge和Google Code上镜像git仓库(在所有主机上同步),因为它们都支持git?
您可以编辑您的 .git / config
文件来创建推送到多个存储库的远程设备。 [remoteeveryone]
url = https://github.com/USERNAME/REPOSITORY.git
url = ssh:// USERNAME @ git。 code.sf.net/p/PROJECTNAME/MOUNTPOINT
url = https://PROJECT.googlecode.com/git
或使用 git config --add
命令:
git config --add remote.everyone.url https://github.com/USERNAME/REPOSITORY.git
git config --add remote.everyone.url ssh://USERNAME@git.code .sf.net / p / PROJECTNAME / MOUNTPOINT
git config --add remote.everyone.url https://PROJECT.googlecode.com/git
现在,当你键入 git push everyone master
时,你会推送maste r分支到所有三个遥控器。
感谢这个堆栈溢出答案
a>的线索。Is it possible to mirror a git repository (sync across all hosts) on GitHub, SourceForge and Google Code given they all support git?
解决方案
You can edit your .git/config
file to create a remote that pushes to multiple repositories.
[remote "everyone"]
url = https://github.com/USERNAME/REPOSITORY.git
url = ssh://USERNAME@git.code.sf.net/p/PROJECTNAME/MOUNTPOINT
url = https://PROJECT.googlecode.com/git
or with the git config --add
command:
git config --add remote.everyone.url https://github.com/USERNAME/REPOSITORY.git
git config --add remote.everyone.url ssh://USERNAME@git.code.sf.net/p/PROJECTNAME/MOUNTPOINT
git config --add remote.everyone.url https://PROJECT.googlecode.com/git
Now when you type git push everyone master
, you'll push the master branch to all three remotes.
Thanks to this Stack Overflow answer for the clue.
这篇关于通过Github,Sourceforge和Google Code镜像存储库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文