/etcgit

Everyone keeps their /etc in git, right?

Primary LanguageShell

Everyone keeps their /etc in git, right?

Naturally I made my own script for it. (Based on something I found somewhere.)
Works on FreeBSD, NetBSD, OpenBSD and Debian-, RedHat- and Alpine-likes.

Setup:
# cd /etc
# git init
# git config user.name root
# git config user.email "root@`hostname`"
# chmod 700 .git

You can add directories to DIRS to include them in the git repo. This
is done automatically for the package-/etc-dirs on FreeBSD and NetBSD.
If you do so core.worktree will be set to / and core.excludesFile will
be set to /etc/.git/etcgit.exclude which will contain everything that
was in "git status" after the first commit. Make sure that nothing
touches your $DIRS while the script is running the first time.