Live data from Hacker News

Using GNU Stow to manage your dotfiles

brandon.invergo.net

1–10 of 69 posts

Re: Using GNU Stow to manage your dotfiles

#3
Very nice! This is something I've always meant to set up but never bothered with. He mentions installing different subsets of your dotfiles on different machines. To do that easily and have it "written down", I'd put a Makefile into the dotfiles directory with .PHONY targets for each machine, and have those targets run the right `stow` commands for me.

Re: Using GNU Stow to manage your dotfiles

#7
> but many/most dotfiles reside at the top-level of your home directory, where it wouldn't be a good idea to initialize a VCS repository.

Right. Which is why I use git with a workspace detached from the git directory. The git directory is in ~/dotfiles/.git, with "git config core.worktree ~", and I set an alias "dgit=git --git-dir ~/dotfiles/.git". The advantage of this method is that there are no symlinks to maintain, however initial clone is a bit painful, since you have to move the files and set the config.

It's not perfectly straightforward, but it's as close to it as I could get it.

Re: Using GNU Stow to manage your dotfiles

#8

> but many/most dotfiles reside at the top-level of your home directory, where it wouldn't be a good idea to initialize a VCS repository. Right. Which is why I use git with a workspace detached from the git directory. The git directory is in ~/dotfiles/.git, with "git config core.worktree ~", and I set an alias "dgit=git --git-dir ~/dotfiles/.git". The advantage of this method is that there are no symlinks to maintai…

That's exactly how vcsh works too.

Re: Using GNU Stow to manage your dotfiles

#9
This makes no sense. Somehow having a versioned dotfiles directory with either a Makefile or a shell script is "hard" because either you need to have Python (no you don't, shell script is fine) or you forget the name of the install script (type ls), but somehow using this software (which needs to be installed) is "easier".

With this software you also need to remember the magic invocation, a trivial thing in both scenarios, but nevertheless something the author complained about, and you also need to install stow. Previously the author complained about adding dependencies in the form or Python (which made no sense, but still, he complained about dependencies) but now he adds this new dependency (which is more rare than python anyway...).

Re: Using GNU Stow to manage your dotfiles

#10

> but many/most dotfiles reside at the top-level of your home directory, where it wouldn't be a good idea to initialize a VCS repository. Right. Which is why I use git with a workspace detached from the git directory. The git directory is in ~/dotfiles/.git, with "git config core.worktree ~", and I set an alias "dgit=git --git-dir ~/dotfiles/.git". The advantage of this method is that there are no symlinks to maintai…

This is great! It fixes the only problem I have with maintaining my dotfiles as a git repo: the .git dir in ~. That interferes with so many things such as the CtrlP vim plugin, the integration of git with the bash prompt and many other things.

Thank you for this.

Post reply on HN