I use Syncthing[1], it is open source and in my opinion a great way to keep your files synced across multiple computers. However I don't think it is the best option to keep code synced. I generally use private git repositories on Bitbucket or GitHub (On Bitbucket you don't have to pay for private repos whereas on GitHub you have to unless you are a student [2]).
[1] https://syncthing.net
[2] https://education.github.com/pack