LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Git and server version control (https://www.linuxquestions.org/questions/linux-newbie-8/git-and-server-version-control-4175503004/)

NotionCommotion 04-25-2014 03:52 PM

Git and server version control
 
I know there are fancy server management packages available, but I don't think I am ready for one.

Instead, I am thinking of just tracking configuration files with Git. My thoughts are to track everything in /etc/. Good idea? Any other folders which I should consider? I will probably do a fresh install, and do my first commit. Then maybe another commit directly after installing a major application (i.e. after installing Apache, then after installing MySQL, etc).

Please provide any comments and/or advice.

Thank you

joe_2000 04-25-2014 04:19 PM

Quote:

Originally Posted by NotionCommotion (Post 5159232)
I know there are fancy server management packages available, but I don't think I am ready for one.

Instead, I am thinking of just tracking configuration files with Git. My thoughts are to track everything in /etc/. Good idea? Any other folders which I should consider? I will probably do a fresh install, and do my first commit. Then maybe another commit directly after installing a major application (i.e. after installing Apache, then after installing MySQL, etc).

Please provide any comments and/or advice.

Thank you

Sounds a bit dangerous, but probably depends on how you plan to use it. Say you commit after installing package xy. Then you realize the installation broke something. What then?
What I am getting at: If you now just revert to the previous commit all you will achieve is getting /etc back to the preinstallation state. What if other directories were changed during the install? What if the regular repair procedure would require the /etc to actually be in the state it was left in by the installation?

I have broken stuff in my system several times by installing packages. More often than not just uninstalling these packages and reinstalling packages that were removed during install repaired everything. You may not have this option anymore if you confuse your system by manually reverting /etc.

Long story short: I think this is a bad idea except if you only want to use git in order to track changes that you made to config files yourself manually, and be able to view older versions of such config files... I might be missing something though...

NotionCommotion 04-25-2014 04:45 PM

Thanks Joe,

I agree willy nilly reverting back to a previous state is a bad idea. My desire is just being able to have history how the configuration was changed, and being able to manually go back to some previous state if necessary.

You think /etc is the only directory worth applying version control?

joe_2000 04-25-2014 04:52 PM

Quote:

Originally Posted by NotionCommotion (Post 5159250)
You think /etc is the only directory worth applying version control?

It depends on your system entirely. If you tweak it, make sure the directory you made changes in is tracked.
In my backup strategy I am backing up the following directories as "system configuration"

"/home/"
"/etc/"
"/opt/"
"/root/"
"/usr/local/bin/"
"/usr/local/include/"
"/usr/src/"
"/var/lib/dpkg"
"/var/lib/apt/extended_states"
"/var/spool/cron/crontabs/"

This does *not* include my personal data, which is only symlinked from /home/userdir. The advantage is that I am also backing up user configurations stored in home separately of user data.


All times are GMT -5. The time now is 01:26 PM.