tags:

views:

76

answers:

1

Hi everyone,

If I'm working with one other developer on the same project, but where we each have our own areas of work (which overlap, but not frequently) how would you recommend we set up git?

+3  A: 

The simplest workflow remains a centralized one (especially with as few developers as you have in your team)

alt text

(much) more detail in this guide.

If you don't have an extra common environment (liek a GitHub for instance), simply create 2 repo per developers:

  • one for working in it (with a working tree)
  • one bare repo (no working tree), for you or your colleague to push to.

In this 2x2 repo setup, you can only push to your bare repo, waiting for your colleague to pull from it:

alt text

Or you can push directly to his public bare repo (for specific patches or contribution to dev2 tasks): dev2 will pull from his own public bare repo:

alt text

In both cases, reconciliation will happen in the private non-bare repo of the developer.

VonC
So your suggesting 4 repos for my setup, where I push to his bare repo and he pushes to my bare repo? Do I then reconcile the two bare repos every now and again?
JP
@JP: Actually, the reconciliation should happen on your working repo (non-bare repo): you are pulling directly from the remote bare repo, and merge in your current branch. And your are pulling from your local bare repo as well, in order to get any changes introduced by your colleague. In both cases, reconciliation is in your local non-bare repo.
VonC
This is perfect - thank you :)
JP