Is putting a Git workspace in a synced folder really a good idea?

I haven’t tried this with syncthing, but would recommend caution. In other systems (dropbox, copy) I have ended up with multiple conflicting copies of files (conflicting-copy-of-foo.txt). This isn’t too bad for the files you are working on, but when this happens in your .git folder the resulting mess can take hours to sort out.

My belt and braces approach is to create a branch for each computer you work on e.g. laptop, chromebook, linode. Have a central repo somewhere like a VPS, or bitbucket where you can have free private repos. If I was working on my laptop, I would be using the laptop branch and commit it it to my central repo. You can automate this via cron, if you wish. If I move to my chromebook, I do a git pull and then merge the laptop branch with the chromebook branch.

This is less hassle than it sounds and has saved me time in the long run.

1 Like