I’ve decided to resurect my Github account and have moved the Space project over there.


https://github.com/fretboardfreak/space

For public projects both Github and Bitbucket provide all the features that I want. However, for open sourced projects, Github shines a little brighter for getting your stuff discovered.

I will however, continue to maintain the public bitbucket location of the project. The repo on bitbucket will simply be a backup mirror for the forseable future though.

To facilitate the mirroring I’m using a new-ish feature in git: pushurls.

A pushurl overrides the normal push URL for a remote. The neat thing is that you can set multiple pushurls for a remote which results in both URLs being pushed to. To set it up I first renamed the bitbucket origin remote to bitbucket. Then I added a github remote. These remotes will stay singular. Next I created a remote called combined and I used the github URL because github will be the primary repository location.

Here is where the secret sauce comes in: to add the two pushurls run the following command once for each URL you want to push to:

git remote set-url --add --push <remote-name> <push-url>

The end result is that my repository’s remotes now look like:

csand@obsidian:~/space$ git remote -v show
bitbucket       git@bitbucket.org:fret/space.git (fetch)
bitbucket       git@bitbucket.org:fret/space.git (push)
combined        git@github.com:fretboardfreak/space.git (fetch)
combined        git@github.com:fretboardfreak/space.git (push)
combined        git@bitbucket.org:fret/space.git (push)
github  git@github.com:fretboardfreak/space.git (fetch)
github  git@github.com:fretboardfreak/space.git (push)
" "