Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Mirroring a repository across Github, Sourceforge and Google Code

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

like image 639
Vasant Avatar asked Nov 14 '12 16:11

Vasant


1 Answers

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://[email protected]/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://[email protected]/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.

like image 132
Stephen Jennings Avatar answered Oct 21 '22 21:10

Stephen Jennings