From Gentoo Wiki
< GitJump to:navigation Jump to:search
Tracking the /etc directory with git is a common procedure within the Gentoo community - although tools exist to solve configuration file change management.
Quick and dirty
The gist of dirty configuration file management with git is as follows:
- Change to the /etc directory:
- Initialize a new git repository:
- Commit initial the initial state and any further known good revisions:
git add * # add all files not in git to the .gitignore file
git commit -m 'required'
- To investigate revisions:
git rev-list #display all revisions
- To checkout/load a specific revision:
git checkout #<(insert a revision hash here>
- To revert unwanted changes:
git reset --hard # undo all changes from revision checked out
git checkout .
- etckeeper — a collection of tools to store /etc in a VCS (version control) repository, to keep a backup of changes to system configuration files