Forget rsync. Just commit changes to the local git repo, then git pull --rebase
to suck in the changes on the other computer (after setting its remote to point to the first computer).
This does mean however that you have to connect your computers each time you sync up, which gets tedious. A less tedious way is to setup an intermediate git repo on a server you control somewhere, then from each computer sync to that networked server's git instance.
For example if you get a VPS hosting account with normal shell access, then after installing git on it, creating a networked repo is as simple as git init --bare
. Then clone it from each of your machines and you're good to go, just push and pull to the intermediate repo to sync changes across machines.
Eg: if your VPS username is "myuserid" on a server running at IP 1.2.3.4, and you've created "mybarerepo" in your VPS home dir, then to clone it onto your local machine you type: git clone ssh://myuserid@1.2.3.4/~/mybarerepo