I have a project I’m working on and have the following set up : one server with my git repos, one desktop pc and a laptop.
I work on my project sometimes on the desktop, sometimes on my laptop.
How can I sync my files between the desktop pc and the laptop without commiting changes to the server ?
You can more or less directly pull and push between your “clients”, i.e. PC and laptop. The transport may be a direct connection like SSH or HTTP. But you can also use another repository on external media, that may be a USB stick, an external hard drive or even a service like Dropbox.
That way your workflow could look like this:
Be aware that you’ll always need to commit your changes locally before you can push them to another repository. It seems like you come from another SCM system like Subversion where committing always means “make the changes visible on the server and for everyone”. Git works different, commits are only local before you push them.