Over the last couple days I’ve briefly talked about revisioning configs and making your home directory portable. It seems to have stirred up a bit of discussion over at Matt Simmons Standalone Sysadmin, and Hugh Browns mentioned he uses mercurial for this task.. As I noted in the post about managing /etc with version control I do revision my home directory, or at least pieces of it.
I consider this to be a different problem than making my environment portable. For example I want my configs to have a full revision history, even things like my ssh config or my private keys. I want that history as a backup, I do not want to distribute all of that information to other machines. gibak is a great wrapper for git to help with this.
Installation is not hard but you will need to install a few dependencies.
Now that its installed you just need to initialize your git repo, make adjustments to your .gitignore (you probably don’t want _everything_ in your repo).
I don’t have everything in my home directory revisioned. Mainly I revision configuration files and my Documents. Here is what my .gitignore looks like.
Now depending on what files you want in your repo and if they change frequently or not you may want to have a cron job to automatically commit changes to your repo. I would suggest an entry similar to this.
To manually commit changes just run gibak commit after making changes.
Now you can deal with your revisioned files just like any other git repo. You can clone it to a remote location to back it up, revert commits or whatever else suits your fancy.