Development Environment with Git + Unison

1k views Asked by At

Is anyone using Unison (http://www.cis.upenn.edu/~bcpierce/unison/) to keep development projects consistent between laptop and desktop or similar?

I'm worried Unison may butcher my git repos. Given MyProject, with the laptop checked out on somebranch and the desktop checked out on someotherbranch, will Unison do the right thing on a sync? I don't care which branch wins, so long as the repos stay viable.

Other suggestions welcome. Rsync is a fallback if nothing else works.

2

There are 2 answers

6
Andrew Schulman On

Yes, I use Unison regularly to sync all of my projects, including bzr and git repos. It works fine. The result is the same as pushing your git repo somewhere and then pulling it again from there, but if you're already using Unison, it eliminates those extra steps if you just sync the repositories. Syncing also picks up your uncommitted changes, which a push + pull won't do.

The only problem I can see happening is if your Unison profile has some ignores set that keep you from syncing all of the objects in the git repo. I think that would be unusual though, and it's never happened to me.

0
Davide Ungari On

I'm using Unison as well and it is working fine for me. The only real problem I had was related to case sensitivity. I installed Unison on my Linux machine and on my MacOSX for synchronizing files between the two. MacOSX by default uses a case-insensitive file-system, so I had some conflicts. The workaround was to create a read-write disk image using Disk Utility and use this newly created volume as my base working directory for working with git-repos.