I am looking for a solution that will allow me to keep a Git repository in sync between my two workstations and my Android smartphone. My workstations turn on and off on a regular basis, and they are almost never on at the same time. My Android device is online almost always, but the network gateway it is connected to changes often. I have a local Git repository on my two workstations that I currently sync manually by bringing both systems online, copying the repo to Dropbox, downloading from Dropbox on the other workstation, and then doing a Git merge. I want to cut Dropbox out of my digital life (due to privacy concerns). I considered substituting Syncthing into this workflow, but after reading countless posts on their form about how Syncthing destroys Git repos, I decided against it.
I am looking for a tool that I can run upon shutdown of my Linux system (both of my workstations run Linux) that will push my local Git repository to either my Android device or my other workstation (I will choose the one that is online at the time) without using a central server. My repository contains sensitive information, so using Github as a middle-man is not an option (and this is also why I am trying to get the repo off Dropbox). I know there are paid private Git hosting services out there that implement full-encryption, but I would rather stick to something free.
In summary, I need a Git synchronization solution that...
- Is free and P2P
- Establishes a connection automatically (like Syncthing, where other nodes are discovered and securely connected to without having to tinker with firewalls or router settings)
- Encrypts data over the network
- Resists repository corruption
Note: I do not need the repository to be in sync in real-time between all three devices. I just want to make sure that when I shut one of my workstations down, it first makes a push to another one of my online devices. This way, my latest commits do not become unaccessible while that workstation is offline. (I have a shutdown script that I use to power off my workstation, so I will integrate this push command somewhere in there.)
git push|pull
whenever they come online and connect to your local network. If it needs to be done from "outside", only use SSH and only allow key-based auth. Nothing is 100% safe or secure, but this would be pretty close.