Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have recently decided to use a version-control system to share my configuration files between my different linux installs.

After reading another thread I found on this subject, I'm planning to do it using git.

I would put my / under revision control with a top-level .gitignore set to * and add manually each configuration file I want to keep track of (mainly files from /etc/…).

What I don't get though, is how I can handle different home directories. As an example, say on machine A I have /home/foo/.vimrc and on machine B /home/bar/.vimrc, how could I get git to keep both files under the same version control repository?


I am looking for a very lightweight solution that does just what I need to (no Puppet or Cfengine for example). I was thinking about creating a .config folder in my /home/whatever/ in which I would keep all my important configuration files using a git repository. A very simple script would then create the needed symbolic links from my /etc/, ~/… and so on. Any other suggestions?

share|improve this question

Arguably, you're trying to use a revision control system to do configuration management. Those are two very different kinds of activities. I think the approach you're taking won't scale well at all, and will lead to significant amounts of frustration. You would be better served to find decide upon a configuration management solution (there's quite a few well matured options out there: cfengine, puppet, chef, etc), and then have your configuration management solution pull its recipes and/or configuration files from the revision control system. It will give you the same net effect that you seem to be looking for, but will have the right tools working on the appropriate parts of the problem.

share|improve this answer
I think the tools you mentioned are too heavy/complex for my needs : they also provide solutions such as auto-installing some packages or finding inconsistencies in confs files and so on. Moreover, some of them need a server running (if I got that right). I want a very lightweight solution that does just what I need to. I was thinking about creating a .config folder in my /home where I would put all my important configuration files. A very simple script would then create the needed symbolic links. Any other suggestion? – FuzzyTern Apr 8 '11 at 17:24
I think the problem is more complex than a simple shell script can accomodate. What happens when a package update changes the files in /etc, or how about when that package update clobbers the symlinks because it moves existing configs to /etc/config.orig and then merges the contents into a new /etc/config file that is now outside the scope of your repository. Having said that, definitely give it a try, but be sure to exercise the system before claiming it a success. :) – ttyS0 Apr 10 '11 at 0:37

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.