1

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...

1
  • I could symlink them into my dropbox instead... Is that a dumb idea? Commented Sep 2, 2012 at 12:18

1 Answer 1

0

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://[email protected]/dean-rather/etc.git.
3
  • ok giving that a try.. Commented Sep 2, 2012 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.. Commented Sep 2, 2012 at 11:17
  • To create a branch use git checkout -b <newbranch>. Commented Sep 3, 2012 at 17:22

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.