Version control on a 2GB USB drive Version control on a 2GB USB drive windows windows

Version control on a 2GB USB drive


I do this with Git. Simply, create a Git repository of your directory:

git-initgit add .git commit -m "Done"

Insert the stick, cd to directory on it (I have a big ext2 file I mount with -o loop), and do:

git-clone --bare /path/to/my/dir

Then, I take the stick to other computer (home, etc.). I can work directly on stick, or clone once again. Go to some dir on the hard disk and:

git-clone /path/to/stick/repos

When I'm done with changes, I do 'git push' back to stick, and when I'm back at work, I 'git push' once again to move the changes from stick to work computer. Once you set this up, you can use 'git pull' to fetch the changes only (you don't need to clone anymore, just the first time) and 'git push' to push the changes the other way.

The beauty of this is that you can see all the changes with 'git log' and even keep some unrelated work in sync when it changes at both places in the meantime.

If you don't like the command line, you can use graphical tools like gitk and git-gui.


Darcs is great for this purpose.

  • I can't vouch for other platforms,but on Windows it's just a singleexecutable file which you could keepon the drive.
  • Most importantly, its interactivecommand line interface is fantasticand very quickly becomes intuitive(I now really miss interactivecommits in any VCS which lacks them) - you don't need to memorise many commands aspart of your normal workflow either. Thisis the main reason I use it over git forpersonal projects.

Setting up:

darcs initdarcs add -r *darcs record -am "Initial commit"

Creating a repository on your lab machine:

darcs get E:\path\to\repos

Checking what you've changed:

darcs whatsnew      # Show all changed hunks of codedarcs whatsnew -ls  # List all modified & new files

Interactively creating a new patch from your changes:

darcs record

Interactively pushing patches to the repository on the drive:

darcs push

It's known to be slow for large projects, but I've never had any performance issues with the small to medium personal projects I've used it on.

Since there's no installation required you could even leave out the drive and just grab the darcs binary from the web - if I've forgotten my drive, I pull a copy of the repository I want to work on from the mirror I keep on my webspace, then create and email patches to myself as files:

darcs get http://example.com/repos/forum/# Make changes and record patchesdarcs send -o C:\changes.patch


You could use Portable Python and Bazaar (Bazaar is a Python app). I like to use Bazaar for my own personal projects because of its extreme simplicity. Plus, it can be portable because Python can be portable. You will just need to install it's dependencies in your Portable Python installation as well.