Live data from Hacker News

Ask HN: What do you use to manage dotfiles?

news.ycombinator.com

41–50 of 97 posts

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

#41
post #33
post #26

Earlier quoted context omitted.

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.

Could you explain how this works? Won't this be putting the .bashrc in $HOME/.myconf/.bashrc, which won't get picked up by bash? (And similar for other dotfiles)

No, since the config alias runs git with the option "--work-tree=$HOME", which tells it that the working directory is your home directory root, i.e. where config files (used to) live.

Anyway it's the proper root for config files, since if you use a .config directory (as seems to be the modern choice) that needs to live in your home directory of course.

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

#42
post #38

I just rebuild them by hand whenever I need to. It helps weed out the crap I've accumulated since the last machine rebuild, and makes sure I don't end up with an ever-growing hairball of dotfile madness.

Agreed, backup is great, but only if you are backing up the right stuff. Sometimes, not backing something up is the right call.

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

#43

Emacs Org-mode's org-babel functionality. I have a few org-mode files storing all the dotfiles, put under version control. I can update and deploy them from within Emacs.

This is the most interesting system I've heard about for dotfiles. How do you organize the org files? Having a single org file with all my dotfiles in it could be interesting but probably unwieldy. It could be interesting to use code block expansion for keeping secrets out of the dotfile source.

I keep my emacs init in org and I can't believe I've never thought of this.

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

#46

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"…

"branches for different computers" sounds tedious if most changes are for every computer.

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

#47
I have everything in ~/dotfiles which is a git repository here: https://github.com/dmarcoux/dotfiles. Basically, I use GNU Stow to symlink what I need. I have master which contains common config and one branch per computer. Everything is explained in the README, in more details if you want do know more. It's not perfect yet, I still have some small irritants, but I'm quite happy with this setup.

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

#48

Emacs Org-mode's org-babel functionality. I have a few org-mode files storing all the dotfiles, put under version control. I can update and deploy them from within Emacs.

fascinating. never heard of doing something like this, though i use emacs all day long (but not org mode -- didn't even know org mode could do this).

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

#50

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"…

Why is this a bare repo as opposed to a normal one?
Post reply on HN