I have my dotfiles in a directory called ~/dotfiles
in my home directory that is the repository. I move my files there, and remove the dot. Then I have a script to symlink them out. But etckeeper works differently...
With etckeeper, you would initialize the repo inside /etc
, not a sub directory. This should be fine, but it creates complications because your gitignore
needs to be a whitelist instead of a blacklist.
The first thing that you should do, is create /etc/.gitignore
. Etckeeper does this automatically, with some defaults, but you want a whitelist, not a blacklist, so add a single *
in the file. This should prevent etckeeper from doing git add
for all your files.
Now do # etckeeper init
to initialize the repo.
Edit your .gitignore
to include the files you want to track. You should write them as !pacman.conf
for example.
From here, you should be able to add your remote, git add
the files you want, then git push
.
But what about when you want to install your etckeeper that you made on another install? You can't clone into an existing dir, so you either have to clone to a new dir, then move the content over to /etc
. But what about etckeeper? I don't know yet...
Work in progress.
- https://wiki.archlinux.org/index.php/Etckeeper
- https://github.com/joeyh/etckeeper
- Reddit threads
- Using etckeeper: https://redd.it/5mxavd
- Pulling from remote: https://redd.it/5nm87w