Tech Blog :: Using git branches as folders to track config files


Oct 31 '10 2:55pm
Tags

Using git branches as folders to track config files

I keep coming back to this method, so I'm putting it here for my own reference:

If you want to use git branches as folders (e.g. to store config files in a single repository), you can initialize a repo (git init), then set the starting branch (instead of the default "master"):

git symbolic-ref HEAD refs/heads/NEWBRANCH (replace NEWBRANCH)

then git add your files, git commit, git remote add REMOTE (the Github repo URL), git push origin NEWBRANCH.

Do that for each config directory you want to track (I have "subdirectory" branch names like server1/apache) and you'll have version control on all your configuration.

Post new comment

Don't bother putting in spam links. They'll be set to rel=nofollow and will be removed and reported as spam shortly after submitting.

The content of this field is kept private and will not be shown publicly.
CAPTCHA
Are you human?