4 ms·
Another approach that avoids symlinks and avoids a git repo in $HOME (i.e. everything is a subdir of that git repo) is to use the option "git-dir" to clone into
by NicolaiS 1y ago
Another approach that avoids symlinks and avoids a git repo in $HOME (i.e. everything is a subdir of that git repo) is to use the option "git-dir" to clone into a subdir, e.g. `$HOME/.dotfiles/` but checkout into $HOME:
git clone --bare git@github.com:.../dotfiles.git $HOME/.dotfiles
git --git-dir=$HOME/.dotfiles/ --work-tree=$HOME checkout
alias dotfiles='git --git-dir=$HOME/.dotfiles/ --work-tree=$HOME'
dotfiles config --local status.showUntrackedFiles no
Now the "dotfiles"-alias can be used like git, "dotfiles add, checkout, log", no symlinks are needed and you avoid "contaminating" subdirs of $HOME (git searches parent dirs for ".git", so a ".git" folder in $HOME kinda sucks)
- andy24 1y agoI use this approach as well, works absolutely great for me.
- abound 1y agoSame, I think I originally got it from the Arch Linux wiki[1], which explains it well. It in turn references HN, to come full circle. [1] https://wiki.archlinux.org/title/Dotfiles#Tracking_dotfiles_directly_with_Git https://wiki.archlinux.org/title/Dotfiles#Tracking_dotfiles_...
- deleted 1y ago[deleted]