4 ms·
The best way I've found to organize dotfiles is to simply use a bare git repo. > git init --bare $HOME/.dotfiles` > alias dot="git --git-dir=$HOME/.dotfiles/
by anschwa 8y ago
The best way I've found to organize dotfiles is to simply use a bare git repo.
> git init --bare $HOME/.dotfiles`
> alias dot="git --git-dir=$HOME/.dotfiles/ --work-tree=$HOME"
> dot config --local status.showUntrackedFiles no
- hashhar 8y agoOh my god. This is a game changer. Thanks a ton for this enlightenment. Any gotchas I need to be aware of? I've been using GNU Stow to manage mine and haven't yet run into issues but it did bring some fiction.
- judge2020 8y agoProbably risking committing secrets if you plan to use this git folder as a sort of "backup" for your dot-files.
- Lio 8y agoOne thing to be aware of is that you need a version of git that supports —-worktree. That may or may not be an issue but the version of git that comes with Ubuntu 16.04LTS for example doesn’t support it.
- pvinis 8y agoI have tried this and it feels nice but I don't want to use git from the command line. I like magit or otherwise fork-app. I didn't find a way to use the bare repo with any of them in an easy way, so I gave up. I use stow now. It alright, but I'll change it in an instant if I found a way to use my tools with a bare git repo.
- anschwa 8y agoI use magit as well. I don't end up editing my dotfiles very often anyway, so it's not a big deal to execute a couple git commands here and there. The convenience of not linking files all over the place or depending on other scripts is pretty great.
- pvinis 8y agoI agree, but for me, I prefer having some symlinks than having to deal with git CLI :(.
- cweagans 8y agoThis is pretty similar to what YADM does, except that the repo lives in ~/.yadm and the cli has some facilities for encrypting/decrypting sensitive files. It also has the capability of running a bootstrap script when you first pull down your dotfiles which is super nice if you need to install some software on your machine.