The short: is there a way to have a git repo push to and pull from a list of remote repos (rather than a single \"origin\")?
The long:
You can configure multiple remote repositories with the git remote
command:
git remote add alt alt-machine:/path/to/repo
To fetch from all the configured remotes and update tracking branches, but not merge into HEAD
, do:
git remote update
If it's not currently connected to one of the remotes, it will take time out or throw an error, and go on to the next. You'll have to manually merge from the fetched repositories, or cherry-pick
, depending on how you want to organize collecting changes.
To fetch the master branch from alt and pull it into your current head, do:
git pull alt master
So in fact git pull
is almost shorthand for git pull origin HEAD
(actually it looks in the config file to determine this, but you get the idea).
For pushing updates, you have to do that to each repo manually.
A push was, I think, designed with the central-repository workflow in mind.