Hacker News new | comments | show | ask | jobs | submit login

For anyone interested in this topic, [0] contains the best setup I've found for storing dotfiles in a git repo, then linking them with GNU Stow. Steps are just:

  git clone https://github.com/me/my-dotfile-repo
  cd my-dotfile-repo
  stow --target=$HOME zsh
  stow --target=$HOME vim
Elegant, cross-platform, easy to remember.

[0]: http://brandon.invergo.net/news/2012-05-26-using-gnu-stow-to...

Sorry if this is a super naive/dumb question, but why wouldn't I simply write a "build" script that copies files out of my dotfile repo to where they're supposed to go?

The copies get out of sync, if you edit ~/.vimrc instead of ~/projects/dotfiles/vimrc you will have a hard time keeping all of your systems in sync.

Replace copies with links and you are golden. Yeah, you can write a simple script to create those links for you, but Stow seems pretty full featured.

1) It's cumbersome, and you'll need to specially handle things like deleting files. I personally wouldn't be comfortable having a homebaked script rm stuff in my home directory.

2) By using copies instead of symlinks you'll need to run your script Everytime you make changes and be careful to edit only your clone instead of the target location.

I second this and highly recommend using stow for this. It takes all of 30 seconds to learn, took me maybe 10 minutes to round up my various dotfiles and move them into a central folder, and, combined with putting them in a VCS, has made life sooooo much easier.

I switched over to Stow last time I set up a new machine and now regret not having discovered it long ago. It always amazes me how for basically any problem you might have there's probably a GNU project to resolve it.

Wow, this is fantastic. I just repo'd all my dot files and used Stow to set them up. Very elegant indeed! Thank you!

Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | Legal | Apply to YC | Contact