2

I am taking over a project where nothing was put under version control. It is an appliance around nagios : there are many system files like nagios or firewall configuration files, some other are scripts or more simply some are symbolic links. To summarize, there are many files with different ownership and permission in several system directories (/etc, /var, /usr ...). I want to put under version control all files that was modified or created for the project, not the operating system itself nor required packages.

git and svn does not save ownership and permission, I do not want to manually build a deployment script neither as there are so many files/owner/permission to manage.

So, how can I put such files directly under version control ?

Eric
  • 5,101
  • 10
  • 37
  • 45

1 Answers1

1

Check out etckeeper, a tool for tracking changes to /etc using Git or other revision control systems:

etckeeper is a collection of tools to let /etc be stored in a git, mercurial, darcs, or bzr repository. It hooks into apt (and other package managers including yum and pacman-g2) to automatically commit changes made to /etc during package upgrades. It tracks file metadata that revison control systems do not normally support, but that is important for /etc, such as the permissions of /etc/shadow. It's quite modular and configurable, while also being simple to use if you understand the basics of working with revision control.

You can use etckeeper on other directories too.

Community
  • 1
  • 1
ChrisGPT was on strike
  • 127,765
  • 105
  • 273
  • 257