
For a while, I’ve been putting some git repos on a thumb drive. It is a practice I have evangelized around the office and it caught some traction, so I figured now is the time to really explore it.
Why? As a developer, I use source control. As a responsible developer, I should use source control even on my crappy little projects and utilities. Since I code both at home and at work, I’d like access to my code in both places. Also, it is damn handy to have a backup.
Why not just use github? At my current level of use, paying for git hosting doesn’t gain me anything. Using github’s free services require that I expose all my code. I like open source, but there is a time and place for NOT opening your source. For example, if you are writing an rpg app that uses material copy written by Wizards of the Coast, it is best to keep that for personal use. It may also be far too early to release because the idea is half baked at best.
Okay, what’s the workflow? How does this work? I pull from the thumb drive, check out what ever branch I want to work on, do stuff, commit locally, and then push to the thumb drive.
Here’s how:
- create a git repo in your project’s working directory
git init . && git add . && git commit -m "initial commit"
- create a bare repository on your drive
f:\ && git init --bare myproj.git
- let your local repository know about the thumb drive
c: && git remote add thumb f:\myproj.git
- push to the thumb drive.
git push thumb master
- (optional) install portable git on your thumb drive.
