I store my config files (~/.bashrc
, ~/.emacs
, ~/emacs
, etc.) in git. The way I configured this was simply to add a git repository in the h
I am using a git repo to manage the dotfiles. It contains:
dotfiles
, which contains the actual dotfiles/dotdirs I want to track.a shell script, to create symbolic link of dotfiles/.*
in $HOME
, like
for dotfile in dotfiles/.* ; do
case $(basename $dotfile) in
.)
;;
..)
;;
*)
ln -sv $(realpath dotfile) $HOME/$(basename $dotfile)
;;
esac
done
The script is manually runned after I add something new in dotfiles
(normally by moving a dotfile into repo), or in a new and clean $HOME
.
The repo can reside anywhere. I have a clone in $HOME
on each host I am using.
In this way I have a much smaller and non-nested work tree, to track the dotfiles selectively.
p.s. You may want to add entries like dotfiles/.config/*
to .gitignore
, it contains many files I don't want to track.