by JoKeru

Git yourself / configuration management server

If you don't know what is Git good for, or if you do, I suggest to start with these two pages: and

Now that everything is clear, we can go on configuring the good stuff:

  • we'll have a central node that will be the configuration management server / repo
  • and X other client nodes that will push their configuration to the central repo

On the central repo:

$ apt-get install git-core
# let's make a git user and not use root for the actual git sync
# you can use ssh keys for the git user so you can script your daily / weekly syncs
$ adduser git
$ su git
# let's make the first repo - let's take an apache document root as an example
$ mkdir node-01.www
$ cd node-01.www
$ git init --bare
Initialized empty Git repository in /home/git/node-01.www/

On node-01:

$ apt-get install git-core
$ git config --global "JoKeru"
$ git config --global "root@node-01"

$ cd /var/www
$ git init
$ # use .gitignore if you don't want to sync files / folders (cache, tmp, logs ...)
$ git add .
$ git status # to check files added
$ git commit -m "initial commit" # now the local repo is done

$ git remote add origin ssh://git@git-central:/home/git/node-01.www
$ git remote show origin
$ git push origin master # now the central repo is also updated
$ git remote show origin

If you want to retrieve the latest configuration for node-01.www repo from the central repo:

$ git clone ssh://git@git-central:/home/git/node-01.www /var/www-from-central-repo

And finally, i suggest you to install this Git Graphical User Interface on the central repo: