views:

35

answers:

1

I have two servers, let's call them first and second. First one is where the real development is done, and second one should be the replica. What I would like to do is put "git push" in post-receive, but there is one problem. Post-receive is executed as the user doing git push to first server, so I can't chmod 600 ssh key with no pass. What is the best practice for this? Thanx!

A: 

I would suggest keeping it simply and just using rsync to copy the bare repository at a certain interval. There might be issues with concurrency when doing that (syncing at the same time as a push comes in). But then again doing multiple simultaneous pushes from the repository (such as if several developers push to the primary server at almost the same time) might have it's problems as well.

calmh