Tony Lindgren wrote: > Anybody have any better ideas for locking that also works with > rsync? Since this seems to be Push Day on the git list, here's my feeble attempt at the same thing (attached cg-push script). I do stuff in this order: 1. read remote HEAD 2. check that a merge from local HEAD to remote would be fast-forward, otherwise tell people to pull and merge. 3. push objects using --ignore-existing (or equivalent) 4. write lock file with --ignore-existing. The lock file contains, in particular, the HEAD to be written. 5. read remote HEAD (again) and the lock file. Bail if HEAD changed since the first read, or if the lock file isn't the one we attempted to write. 6. write remote HEAD and delete lock file in using rsync's --delete-after This should always be safe, since rsync (as I understand the man page) always writes to temp files, and then renames into place. Checking for fast-forward-mergability assures that other peoples changes don't get lost. cg-push determines uri and foreign branch name using the same rules as cg-pull, which is real nice as it allows you to do: $ cg-clone me@myserver.example.com:git-repos/myrepo.git mystuff $ cd mystuff # write some stuff $ cg-commit $ cg-push and later $ cg-update # write more stuff $ cg-commit $ cg-push and even later $ cg-branch-add pub me@myserver.example.com:public-repos/myrepo.git $ cg-push pub So, you can work pretty much exactly as you would do in CVS or svn, if you're so inclined, safely sharing a common repository among many users. Which is kinda neat, if I may say so myself... /dan