Live data from Hacker News

Versioning Your Home Directory

martinovic.blog

41–45 of 45 posts

Re: Versioning Your Home Directory

#41

For dotfiles I use the workflow from this comment https://news.ycombinator.com/item?id=11071754 with a keybase encrypted repo I use: git init --bare $HOME/.myconf alias config='/usr/bin/git --git-dir=$HOME/.myconf/ --work-tree=$HOME' config config status.showUntrackedFiles no where my ~/.myconf directory is a git bare repository. Then any file within the home folder can be versioned with normal commands like: config…

I do this as well for the moment, but I find it slightly annoying, because it doesn't play nicely with Magit or zsh autocomplete.

Re: Versioning Your Home Directory

#42
post #24

The vcs-home website has more tips for version control of home directories: https://vcs-home.branchable.com/

vcsh + mr works well for me.

One feature of this pair (unique to them?) that I find useful is the ability to apply different subsets of my repos to any given account's home directory.

Re: Versioning Your Home Directory

#43
post #3

That's probably the worst possible way of versioning your home besides, possibly, making a zip of your whole home directory every time you would otherwise to a commit. Just use a snapshot-enabled filesystem. ZFS works awesomely, BTRFS too (but it's not released as stable and production ready AFAIK) and LVM can have snapshots too (take a look at the snapper project by Red Hat). Just use ZFS and snapshot the whole file…

Except you don't get nice per-file history, which may not be important to you, but if it is, then using git is certainly not "the worst possible way of versioning your home besides, possibly, making a zip of your whole home directory every time you would otherwise to a commit". Filesystem snapshotting also makes it more complicated to sync your dotfiles with machines that have other filesystems.

Re: Versioning Your Home Directory

#44
post #32

Earlier quoted context omitted.

The ZFS tools don't really cover the case of ignoring a bunch of transient files in your home directory that you don't want to sync around. Things like browser temp files, etc.

You know, this aspect of versioning a home directory is basically why home directories aren't versioned very often. That being said, if you want to "version your home directory", I think that zfs is the best approach. Also, transient files and browser temp files should reside on /tmp AFAIK... So that's less of an issue. If you application is writing temporary files outside of /tmp, then it's probably a bug.

Take your chrome browser history. That doesn't really belong in /tmp, but it's also not something that's going to sync around well with zfs, either.
Post reply on HN