From: Junio C Hamano Date: Thu, 19 Jan 2006 05:05:01 GMT Subject: Re: /etc in git? Message-ID: <7v64ogkdtu.fsf@assigned-by-dhcp.cox.net> In-Reply-To: Adam Hunt writes: > Do you have any more details by chance? Does it work? Does it work > well? How does one do it? I personally feel it is a horrible and stupid thing to do, if by "version control /etc" you mean to have /.git which controls /etc/hosts and stuff in place. It would work (git does not refuse to run as root). But being a *source* control system, we deliberately refuse to store the full permission bits, so if your /etc/shadow is mode 0600 while /etc/hosts is mode 0644, you have to make sure they stay that way after checking things out. You are much better off to keep /usr/src/rootstuff/.git (and working tree files are /usr/src/rootstuff/etc/hosts and friends), have a build procedure (read: Makefile) there, and version control that source directory. I usually have 'install' and 'diff' target in that Makefile, so that I can do this: $ cd /usr/src/rootstuff $ make diff ;# to see if somebody edited any targets by hand $ edit etc/hosts $ git diff ;# to see the source change $ make diff ;# to see the change I am going to install $ su # make install; exit $ git commit -a -m 'Add a new host.' Being able to run "diff" before actually doing it is very handy and useful safety/sanity measure. Obviously, /usr/src/rootstuff/ should be mode 0770 or stricter, owned by the operator group; it would contain some sensitive information.