Working offline using git

I don’t have access to the internet at home right now. This is making me surprisingly productive, yet I have the need for source code management. Setting up a local Subversion server is not really an alternative, because I do not even have a network set up yet. I further want to easily exchange code between my workstation and my laptop using a humble USB stick, having a way of merging conflicting changes if necessary.

Remembering a talk of Torvalds (do watch it if you have the time, it’s quite entertaining), I thought that git might be just the tool for the job.

Luckily, I already had it installed on both machines, so all I had to do was to learn to use it. There’s great documentation in the form of man pages, so it wasn’t really a problem to learn about it offline. After a few minutes, I knew enough to get me started.

It works just great: You can turn any local directory into a git repository and work there, committing, reverting and branching all you like. If you want to work somewhere else, you clone the repository and then pull from it whenever it changes. For instance: I worked on my workstation, then pulled from this repository on the repository on my USB stick and finally pulled from the USB stick repository on my laptop. Whenever you pull changes, you are able to inspect the changes and merge selectively.

I’m pretty determined to work on all of my projects using git in the future, probably using git-svn at first.

Leave a Reply