Live data from Hacker News

Using GNU Stow to manage your dotfiles

brandon.invergo.net

1–10 of 73 posts

Re: Using GNU Stow to manage your dotfiles

#2
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

I totally disagree. I love having much of my home directory in git. I have a .gitiignore for the stuff I don't want in there, but the rest. Ahhhhh, so nice to be able to clone somewhere else and use.

Re: Using GNU Stow to manage your dotfiles

#3
I did not know about GNU Stow. I want to try to use this for my dotfiles along with a simple Makefile to automate calling stow on all of the directories. This will also be a nice way to manage the differences between my home configuration and work configuration. One make rule per environment. Thanks for sharing.

Re: Using GNU Stow to manage your dotfiles

#4
I'm very proud of my server's top-level[1] for the past fifteen years:

  $ ls -A
  .gitconfig@  .hushlogin  .local/  .notes/  .ssh/  www@  .zshrc@
All other dotfiles are configured to be picked up from somewhere inside .local either using environment variables or aliases.

[1] On the other hand, the laptop -- where I run X and gnome -- is a disaster.

Re: Using GNU Stow to manage your dotfiles

#5
If I may, a small plug for my solution to this problem:

https://bitbucket.org/davidn/dotstuff

I settled on copying rather than symlinking, which has the benefit that the source files can be passed through a simple preprocessor to do some customization for different systems. Also you can get a diff between your current files and the state that you just synced.

Re: Using GNU Stow to manage your dotfiles

#6
post #2

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 I totally disagree. I love having much of my home directory in git. I have a .gitiignore for the stuff I don't want in there, but the rest. Ahhhhh, so nice to be able to clone somewhere else and use.

I take a similar approach. I have a dotfiles git repo in ~/dotfiles/ and have a Makefile which creates symlinks in my home directory. For example, ~/.bashrc is a symlink to ~/dotfiles/bashrc. That way, I can have a whitelist (whatever's in the Makefile) instead of a blacklist (like a .gitignore).

Re: Using GNU Stow to manage your dotfiles

#9
post #2

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 I totally disagree. I love having much of my home directory in git. I have a .gitiignore for the stuff I don't want in there, but the rest. Ahhhhh, so nice to be able to clone somewhere else and use.

I also keep my whole homedir in git, and it's great. My approach isn't to .gitignore, because I want to ignore almost everything -- I just add and commit things when I want to track them. One of my many git aliases[1] is 'git sn' for showing status without untracked files; this helps when dealing with my homedir:

  status --short --branch --untracked=no
[1] https://github.com/cespare/dotfiles/blob/master/.gitconfig#L...
Post reply on HN