Live data from Hacker News

Way to store your dotfiles: A bare Git repository (2016)

atlassian.com

1–10 of 60 posts

Re: Way to store your dotfiles: A bare Git repository (2016)

#3
I'm still looking for a good way to I'm using this approach, but looking for a way manage dotfiles for multiple machines. Having separate branches feels clunky, since there is a lot of overlap and tweak may involve making the same tweak on several branches. Any recommendations for managing this situation?

Re: Way to store your dotfiles: A bare Git repository (2016)

#4
I use something even simpler

My dotfiles git repo is meant to be cloned in my home directory. It comes with this .gitignore committed in the repo:

  /*
  !/.vim/
  /.vim/.netrwhist
Basically it ignores everything in my home directory, unless I explicitly `git add` it, which matches my workflow. For the few cases where I want to notice changes (like the entire ~/.vim/ subdirectory), I explicitly un-ignore it as you can see above.

The only downside I've experienced is my bash PS1 prompt shows the status of the dotfiles repo (branch/dirty/etc) in any directory I'm in that's inside my home dir - I've learnt to ignore it, and it doesn't interfere with CDing into an actual directory that's its own git repo.

Re: Way to store your dotfiles: A bare Git repository (2016)

#5
post #2

Seems much more complicated compared to: git checkout https://github.com/my/dotfiles.git cd dotfiles # this is little more than `find . -maxdepth 1 -exec ln -sf {} ~/ \;` ./install How are others here managing their dotfiles?

I use stow. But honestly, I don't think it's better than git.

Re: Way to store your dotfiles: A bare Git repository (2016)

#6
post #2

Seems much more complicated compared to: git checkout https://github.com/my/dotfiles.git cd dotfiles # this is little more than `find . -maxdepth 1 -exec ln -sf {} ~/ \;` ./install How are others here managing their dotfiles?

I do almost exactly the same as you; my install.sh is a glorified wrapper around `ln -s`, but for each file, it verifies whether the file is already symlinked and if not renames the original to something like `.foo.bak.$(date -I)`. This is probably overkill, but it was especially nice when I was just starting to version control my dotfiles and still found unmanaged files sometimes that contained things worth saving.

Re: Way to store your dotfiles: A bare Git repository (2016)

#7
post #5
post #2

Seems much more complicated compared to: git checkout https://github.com/my/dotfiles.git cd dotfiles # this is little more than `find . -maxdepth 1 -exec ln -sf {} ~/ \;` ./install How are others here managing their dotfiles?

I use stow. But honestly, I don't think it's better than git.

It's orthogonal, isn't it? You keep your dotfiles in a repo, then have stow "install" the checkout/clone thereof.

EDIT: Also on stow - I tried it a couple times and it never seemed flexible enough. Can it handle things like keeping ~/.config/nvim and ~/.vim in the same stow directory? (And for that matter, can it link them together? I like having the same config for vim and neovim)

Re: Way to store your dotfiles: A bare Git repository (2016)

#8
post #5
post #2

Seems much more complicated compared to: git checkout https://github.com/my/dotfiles.git cd dotfiles # this is little more than `find . -maxdepth 1 -exec ln -sf {} ~/ \;` ./install How are others here managing their dotfiles?

I use stow. But honestly, I don't think it's better than git.

Are you using stow for some specific reason? Or just trying it out?

Re: Way to store your dotfiles: A bare Git repository (2016)

#9
post #2

Seems much more complicated compared to: git checkout https://github.com/my/dotfiles.git cd dotfiles # this is little more than `find . -maxdepth 1 -exec ln -sf {} ~/ \;` ./install How are others here managing their dotfiles?

I do almost exactly the same as you; my install.sh is a glorified wrapper around `ln -s`, but for each file, it verifies whether the file is already symlinked and if not renames the original to something like `.foo.bak.$(date -I)`. This is probably overkill, but it was especially nice when I was just starting to version control my dotfiles and still found unmanaged files sometimes that contained things worth saving.

Can you share?

Re: Way to store your dotfiles: A bare Git repository (2016)

#10
post #5
post #2

Seems much more complicated compared to: git checkout https://github.com/my/dotfiles.git cd dotfiles # this is little more than `find . -maxdepth 1 -exec ln -sf {} ~/ \;` ./install How are others here managing their dotfiles?

I use stow. But honestly, I don't think it's better than git.

Same - git repository (I presume), and GNU stow. Stow is a good way to maintain symlinks, but I see the value of not having that additional dependency. The OP's method is nifty, I might try it out.
Post reply on HN