For the encrypted git repo, I use this:
https://github.com/AGWA/git-crypt
The cron points to a shell script:
#!/bin/sh
cd ~/notes
git add -A .
git commit -am wip
git pull
git push
So with that, I have the same directory, ~/notes/ syncd on all of my computers automatically, as long as I don't do conflicting edits within the space of a minute, which has never happened.
Does this get annoying if you want to commit something specific? Let's say you edit an old note and save the file. Then, in the time it takes for you to write a commit about this new edit, your cron script has added your change as a 'wip'.
Also, is there a nice way to set this up with a cron script so that you can use git via ssh (rather than https) but still keep a passphrase on the key? I seem to remember having problems with cron and git regarding ssh keys.
I never do manual commits here; every single commit is always 'wip'. I'm basically not using that feature of git. I'm just using it for (dumb) history/backup and distribution.
I always setup the git repos with ssh, not https. The central (for each environment) git repo is a bare checkout on my personal account on a linode or tektonic VPS.
In short, since I can ssh from my various client machines to these central servers with no password, the git pull/push just works.