SaturdayHouse Lifehack #1 – Using Subversion to Manage Your Home Dir

I’ve been attending SaturdayHouse consistently for the past three months. A brief description of SaturdayHouse:

Seattle Saturday House is a weekly gathering of several people who meet and do … whatever they want! People work on projects, people talk about ideas, people conspire and hatch plans, and people play games with each other.

Last Saturday, people held a session about “hacks that make life simpler.” I took notes, and I’ve cleaned them up here for your viewing. If you’ve got any additional ideas to share or if you were one of the presenters and want to correct something I’ve posted here, please let me know by leaving a comment or emailing me (cal /at/ calvinfreitas dot com).

#1: Using Subversion to Manage Your Home Directory (/home/username/) — Patrick
Patrick suggests using Subversion as a way to manage and synchronize your home directory between multiple machines. The benefits of such as strategy is it allows for version control of your documents and the ability to keep them all in order no matter what computer you’re using so long as you’ve got internet access in order to grab your latest repository copy.

The actual functioning of Subversion was outside the scope of this discussion, but if you’re looking for information go to the Subversion website.

Patrick mentioned that if he could restart his method from the beginning, he would actually set up a few separate repositories. For example, separate ones for:

  • /home/patrick/etc
  • /home/patrick/bin
  • /home/patrick/lib

The benefit of having separate ones being less customization to do because if you have only one there’s going to be a number of files/directories you’ll want to exclude for various reasons.

Patrick has also created a custom Makefile — allows him to run specific custom commands in his home dir (e.g. make test). In the makefile he has a “test” function that runs some basic commands to display the following.

your home is /home/patrick
your uname is linux
date is 20080225174525

Patrick uses the Makefile for scripts he’s written over his lifetime that does something he wants. When necessary, he can add new basic commands to the script to give him new functionality from the command line. Recently, he’s had people bugging him to start using Twitter so he added a new “tweet” function to his makefile.

Because he has his Makefile and all his other scripts in Subversion, he can use them wherever he wants. Desktop w/ linux? Checks out his latest code from Subversion. After creating and editing new files, synchronize to a web host to make sure the newest files will be available from his other machines. Then when the laptop needs to get the latest files, he does a checkout from the web host and now he’s up to date again.

Suggestions from others: Jdugan recommends using Mercurial — fewer dependencies than Subversion. Someone else suggested creating a /home/user/tricks folder that includes any scripts acquired w/ useful functionality and checking it into a repository to take your scripts anywhere with you.

Patrick’s Makefile:
Download It Here — Please note that the bottom portion of the text file should actually be put into a separate file in /home/username/etc/Makefile.linux

Hosting: If you don’t have a web host where you can host your subversion repository, its usefulness will be slightly more limited. Personally, I recommend Dreamhost — easy host to deal w/ and Subversion is a quick install (to svn.example.com) — but there are plenty of other good hosts as well, feel free to recommend some in the comments.

Update (2015): Use git. GitHub, GitLab, or BitBucket for hosted git.

2 Replies to “SaturdayHouse Lifehack #1 – Using Subversion to Manage Your Home Dir”

Comments are closed.