Version Control for System Administrators

user warning: Table './drinking_drpl2/watchdog' is marked as crashed and last (automatic?) repair failed query: INSERT INTO watchdog (uid, type, message, variables, severity, link, location, referer, hostname, timestamp) VALUES (0, 'flickr', 'Could not connect to Flickr, Error: Forbidden', 'a:0:{}', 4, '', 'http://rothwerx.com/content/version-control-system-administrators', '', '54.145.95.149', 1503100230) in /home1/drinking/public_html/rothwerx/modules/dblog/dblog.module on line 146.

Jeremiah - Posted on 14 March 2012

It's not uncommon for me to set up a local git repo for a project I'm working on. I understand the benefits of using version control for software projects. But for some reason, working a central VCS into my day-to-day workflow with multiple servers just eluded me.

I've had a http://projectlocker.com account, and I just signed up with http://beanstalkapp.com. My needs aren't great, I just want to keep the occasional script and/or configuration file in a central location. You know, the "cloud". You could create new repos for each parent directory you want to store in version control, but you're limited if you're just using free accounts on these VCS hosts.

I don't want to have to download the whole tree of configs and scripts every time I want something. But all the VCS tutorials would have you do just that, because that's what makes sense for a software project.

Anyway, I think I have a good way to go about it for my needs. I chose subversion because my needs are simple and it seems more ubiquitous. Both ProjectLocker and Beanstalk will do either subversion or git though.

The key is making your directory hierarchy through 'svn mkdir'. So say you have a server named 'whoracle' and you want to put the whole /etc directory in version control. You might do something like:

svn mkdir --parents https://[your subversion url]/basedir/whoracle/etc -m "Adding stuff from whoracle"
cd /etc
svn checkout https://[your subversion url]/basedir/whoracle/etc/ .
svn add *
svn commit -m "Adding all the configs"

This might not be the best way, but it's the best way I've found. If you have any other tips, add them to the comments.