Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

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'd like to keep some of the folders in my /etc/ dir git-revised, cause I'm quite new to server administration and am constantly messing around in my /etc/nginx/ and /etc/bind/ directories.

I've heard of people git-revising their either /etc/ directories, but that seems a bit like overkill, as at this point I'm only messing in those 2 subdirectories.

The problem I'm having is that if I sudo my git operations, I don't have the right pubkeys to push to my remote repo (bitbucket). But if I don't sudo, I need to mess around with all the permissions (again, not very pro at this).

Does anyone know best practices for managing their configs? or how I should solve this problem?

Thanks, Dean.

PS. It's Ubuntu 12.04, Git, nginx, bind9, amazon aws, bitbucket...

share|improve this question
I could symlink them into my dropbox instead... Is that a dumb idea? – Dean Rather Sep 2 '12 at 12:18

Make it hierarchical.

Have an ordinary user use bitbucket as the remote and store the repo in their home directory. Then have /etc/ use the repo in the homedir as the remote.

In other words...

  • Git repo used by root in /etc/ has remote of /home/dean-rather/git/etc/.
  • Git repo used by dean-rather in /home/dean-rather/git/etc/ has remote of git://
share|improve this answer
ok giving that a try.. – Dean Rather Sep 2 '12 at 11:00
having heaps of trouble with making a repo to begin with... cd /etc/nginx sudo git init sudo git add ./* sudo git init -a -m "initial commit" sudo git branch nginx -> error: fatal: Not a valid object name: 'master' ... sudo git branch -> blank.. – Dean Rather Sep 2 '12 at 11:17
To create a branch use git checkout -b <newbranch>. – bahamat Sep 3 '12 at 17:22

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.