News for hackers. Stuff that matters.
Re:A Way to Manage Dotfiles by uneekname on Wednesday May 12, 2021 @04:25PM (#27134726)
I like the bare repository approach here. I've been using symbolic links to version control my dotfiles with git.
Re:A Way to Manage Dotfiles by poidos on Wednesday May 12, 2021 @04:27PM (#27134754)
I do the same using `stow`, and like it a lot.
Re:A Way to Manage Dotfiles by lefrenchy on Wednesday May 12, 2021 @05:03PM (#27135121)
I gave it a quick glance but didn't understand, how is OP's link managing it instead of symbolic links?
Re:A Way to Manage Dotfiles by bminusl on Wednesday May 12, 2021 @05:31PM (#27135385)
Files are tracked by a bare git repository, e.g. `~/.dotfiles`.

The trick is to use the combination of --git-dir and --work-tree git options. An alias can be defined to simplify the process: `alias dotfiles='/usr/bin/git --git-dir=$HOME/.dotfiles/ --work-tree=$HOME'`.

`dotfiles` can be used as you would use `git`, e.g.:

- `dotfiles add <file>`

- `dotfiles commit [options]`

Re:A Way to Manage Dotfiles by yjftsjthsd-h on Wednesday May 12, 2021 @05:32PM (#27135395)
By telling git to use `--work-tree=$HOME`, they tell git to directly work on the files in their home directory; no symlinks needed.