Live data from Hacker News

Ask HN: What do you use to manage dotfiles?

news.ycombinator.com

21–30 of 97 posts

Re: Ask HN: What do you use to manage dotfiles?

#21
I think no one has mentioned rcm[1]. I just maintain a private git repository cloned in .dotfiles in each system I own, and use rcm to set up symbolic links properly. It works pretty well with directories and lets you choose between creating and populating it with symlinks, or just symlinking the whole directory. For example, I can symlink the full .vim directory (including git submodules) and only link some files inside the .ssh directory (link the config file to my .dotfiles repo but leave ssh keys alone).

1: https://robots.thoughtbot.com/rcm-for-rc-files-in-dotfiles-r...

Re: Ask HN: What do you use to manage dotfiles?

#26

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 status config add .vimrc config commit -m "Add vimrc" config add .config/redshift.conf config commit -m "Add redshift config"…

Honestly this is genius! I hadn't thought of doing it like that, thank you! I had resorted to the usual .cfg folder and a helper script to link/update everything.

Re: Ask HN: What do you use to manage dotfiles?

#27

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 status config add .vimrc config commit -m "Add vimrc" config add .config/redshift.conf config commit -m "Add redshift config"…

To complete the description of the workflow (for others), you can replicate your home directory on a new machine using the following command:

   git clone --separate-git-dir=~/.myconf /path/to/repo ~
This is the best solution I've seen so far, and I may adopt it next time I get the itch to reconfigure my environment.

Re: Ask HN: What do you use to manage dotfiles?

#30
I use a git repository, cloned in .myconfigs, with a script that create a symlink for any file in it (apart from .git and a couple more)

https://github.com/riquito/configs

The usage is

    git clone git@github.com:username/configs.git ~/.myconfigs
    cd ~/.myconfigs
    ./reinstall.sh
Whenever I update the repository, maybe adding files, I run this in the other computers:

    cd ~/.myconfigs
    git pull --ff-only
    ./reinstall.sh
which simply refresh the symlinks (I should remove stale symlinks now that I think about it, for removed configurations - never happened yet)
Post reply on HN