Live data from Hacker News

Versioning Your Home Directory

martinovic.blog

21–30 of 45 posts

Re: Versioning Your Home Directory

#21
I used to do this (using CVS, at the time), for keeping the configs and projects on my desktop and laptop in sync, as well as for having backups. Quick small notes:

* I split everything into topical modules, which were immediate subdirectories of the home directory, partly so the little laptop didn't have to install everything.

* There was a "config" directory that included most of the typical home directory dotfiles, as well as things like fonts. It had a small shell script in it, for keeping symlinks from the home dir up to date (e.g., "~/.bashrc" was a symlink to "config/bashrc".

* Not everything was in CVS. Photos, for example, were backed up separately.

* It was good to have my server Internet-accessible, since a few times I'd walk for an hour to work from my laptop, and realize I didn't have the latest version of my code.

* Nowadays I would probably use Git, only for the sake of standardizing, but the simple model of CVS was nice for this purpose. (I also knew many other fancier SCM systems, but intentionally went with a simple one.) Also, the repository was just in RCS format (files with reverse deltas of diffs), so, on rare occasions that I made an oops (like accidentally committed a huge file I didn't intend to), I could just SSH in and fix it manually.

* I had various servers for this over time, starting with my desktop, and then a PC in the closet, then a colo server, and then (my favorite) a small home RAID server I made from a fanless Atom board and Debian (which was effectively silent, running years 24/7 before I finally took it out of service, still working; one drive had to be replaced during that time, but was RAID mirrored).

Re: Versioning Your Home Directory

#22
Meh. I treat my home dir as a scratch space and symlink important things to version controlled and synced subdirs.

Too many things come and go to justify a git workflow to me. And git ignoring wide swaths of private data seems haphazard at best.

Re: Versioning Your Home Directory

#23
I used to version whole home directory, turned to stow + dotfiles recently, reasons:

1. maintaining .gitignore is kind of annoying.

2. I don't need all my configuration files on some machines, say a remote sever, you can just stow what you need instead of adding many files to your home.

3. it's not convenient setting up an environment when you already have many files in home, for git clone to a directory not empty is not allowed.

Re: Versioning Your Home Directory

#25
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…

I don’t have ZFS on every PC I work with.

Re: Versioning Your Home Directory

#27
post #23

I used to version whole home directory, turned to stow + dotfiles recently, reasons: 1. maintaining .gitignore is kind of annoying. 2. I don't need all my configuration files on some machines, say a remote sever, you can just stow what you need instead of adding many files to your home. 3. it's not convenient setting up an environment when you already have many files in home, for git clone to a directory not empty is…

my .gitignore is set to ignore everything with a wildcard and un-ignore a few hidden directories where i'm likely to place new files (e.g., .vim, .zsh)

Re: Versioning Your Home Directory

#28
post #4

Earlier quoted context omitted.

How would you transfer a snapshot to another machine? That's the use case.

There's always zfs send and zfs receive, but these don't work automatically.

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.

Re: Versioning Your Home Directory

#30
post #17
post #16

Earlier quoted context omitted.

Be careful with git repositories shared in Dropbox in this manner. If you are running an ide on multiple machines, the idle ones might do some crazy things to your .git tree. You can look for signs of trouble by running “find .git/ -name ‘ conflict ’”.

Blerg. There should be asterisks around that italicized conflict word.

  find .git/ -name '*conflict*'
There ya go.
Post reply on HN