Mirroring a repository across Github, Sourceforge and Google Code

扶醉桌前 提交于 2020-01-22 11:34:23

问题


Is it possible to mirror a git repository (sync across all hosts) on GitHub, SourceForge and Google Code given they all support git?


回答1:


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.



来源:https://stackoverflow.com/questions/13382415/mirroring-a-repository-across-github-sourceforge-and-google-code

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!