Using git to manage /etc?

The program etckeeper does manage /etc in git, you just need to change the default vcs backend from bzr to git in /etc/etckeeper/etckeeper.conf.

It is installed by default in Ubuntu Linux, and handles the common cases of when to commit automatically.
It commits before installing packages in case there are uncomitted manual changes, and after installing.


The problem with tracking configuration for /etc in git is that all you really gain by doing so is version control (most git novices don't even know how to tag and branch properly, so unlikely at that point) and the ability to rollback (again, if you aren't tagging properly, you don't gain anything but a log to blame people); but you lose templating (cant template because git doesn't provide that), and scaling out (you cant apply the configuration anywhere else; especially if you are using distributed databases like Elasticsearch), and automated systems management (again, git doesnt provide this).

With that being said, what you are probably looking for is configuration management; that ties in templating, git, and basic scripting to manage configuration. This, of course is going down the direction of DevOps and Infrastructure as Code.

To add to this; Ansible has ansible-pull which can pull the latest repo of your playbooks from git; the same is also true for Chef. Basically, modern Linux administrators shouldn't be using something like etckeeper. Chef also has client-server mode where you can manage all systems with the chef-client based on environment, roles, and cookbook versions; things you cannot do with git solely and at scale.