Liberapay Patrons Follow Me on LinkedIn Follow Me on Twitter Published Rubygems

The problem with a Monopoly in a Decentralized ecosystem…

It kills the ecosystem. Oh hello GitHub, I didn’t notice you standing there.

We need the D in DVCS

But how do you get it?

Pushing to multiple source code hosts needs to be as easy as git push all.

This process was primarily derived from a much more in depth StackOverflow.

$ git clone git://original/repo.git
$ git remote -v
origin  git://original/repo.git (fetch)
origin  git://original/repo.git (push)

# Add the original again, as a duplicate remote named "all":

$ git remote add all git://original/repo.git
$ git remote -v
all git://original/repo.git (fetch)               # <-- ADDED
all git://original/repo.git (push)                # <-- ADDED
origin  git://original/repo.git (fetch)
origin  git://original/repo.git (push)

# Add an alternate source host to "all"
# Unfortunately this changes the original push host for "all"...

$ git remote set-url --add --push all git://another/repo.git
$ git remote -v
all git://original/repo.git (fetch)
all git://another/repo.git (push)                 <-- CHANGED
origin  git://original/repo.git (fetch)
origin  git://original/repo.git (push)

# Rather than being strictly additive the push url was altered,
#   so in a strange twist we have to add back the original... again
#   to end up with multiple push hosts

$ git remote set-url --add --push all git://original/repo.git
$ git remote -v
all git://original/repo.git (fetch)
all git://another/repo.git (push)
all git://original/repo.git (push)                <-- ADDED
origin  git://original/repo.git (fetch)
origin  git://original/repo.git (push)

And there you have it!

$ git push all

What source code forges (hosts) do I recommend?

Hero image (cropped) by fabio