views:

88

answers:

2

I have a central git repository that everyone pushes to for testing and integration, but it only is pushed to when features are 'ready'. While in the middle of a big task, developers frequently have many commits that stay on their harddrives.

Sometimes in the middle of these projects I'd like to either see what another developer is doing, or show him how I've done something. I'd like to be able to tell another developer to just "pull my working copy"

The only way I can think of is having everyone run ssh on their development machines and adding accounts or ssh keys for everyone, but this is a huge privacy and permissions nightmare, and seems like a lot of work to maintain.

Should we just be pushing to that central repository in these cases? Should we be pushing after every local commit?

+1  A: 

Two common approaches:

  • developers have their own public repos (for example mpd and associated programs).
  • developers push to refs in their own namespace on a central repo (dev1/master, dev2/master). Depending on your exact situation, you might want some access control in the form of hooks to make sure no one does anything silly.
Jefromi
+3  A: 

We use branches for code that isn't "ready" yet, and the branches get pushed to a central repo (which is backed up!). When a new feature becomes "ready" it gets merged into the master branch.

One of the benefits of using git is that it is very, very easy to create and merge branches, plus you can visualize what's happening using gitk. Recommended!

Norman Ramsey
I forget where I learned this - if you have multiple developers have each developer work on one or more branches prefixed by their initials, e.g. nr/proposed, nr/line-end-fixes, and only use master branch for integration. Branches can then be pushed around repositories and the original source remains clear, and there are no branch name conflicts.
Stuart Ellis
This does kind of fit with the git philosophy of feature branches... it's just feature branches remotely. A project of mine uses this approach and it seems to be working out well.
RyanWilcox