Track multiple remote branches

Jasiu picture Jasiu · Dec 27, 2010 · Viewed 10.6k times · Source

So let's say there are three developers: Alice, Bob, and Cecil. They decide to use Git without a central repo. They all set up remotes to each other, so that:

  • Alice has remotes/bob/master
  • Alice has remotes/cecil/master
  • Bob has remotes/alice/master
  • Bob has remotes/cecil/master
  • Cecil has remotes/alice/master
  • Cecil has remotes/bob/master

And now, Alice wants her local master branch to track both remote master branches. Is that even possible in Git? If not, what workflow do you guys use to work around this?

Answer

Arafangion picture Arafangion · Dec 27, 2010

How to track more than one remote with a given branch using Git?

In short, "can't be done unless you write a custom script/program/alias".

I suggest that they either agree on a common central branch that holds the development tree, or that they send each other pull requests instead of asking each developer to track every other developer.