Necoro’s Blog

Blog? Blog? There is no blog…

Managing your configuration files with Git. Revisited.

leave a comment »

I showed a way of managing the configuration files with git and StGit in the post two days ago. But this has two disadvantages:

  1. StGit is not installed on all systems. And though it is only some Python-Code which is not hard to install in your home directory, it is something I’d like to avoid.
  2. Using two commands (config and cstg) is not the best thing. Having only one command would be better…

So I tried the more natural way (often I tend to think way too complex) of using git branches. I created a “local” branch, which is used for the local changes (hah – you could not guess it :P). And then I only use rebasing to pull global changes.

Update: In the meantime I switched back to using stgit … it just worked somewhat better. But the approach mentioned here still works pretty good :)

Compared to the older method, the approach is now:

  1. Same as the old one.
  2. Create local branch and use it:
    config checkout -b local
    # hack hack hack
    config commit -a
    # ...
    
  3. Change to master and work there
    config checkout master
    # make changes
    config commit -a
    config push
    config checkout local
    config rebase master
    
  4. Same (except step 7 of course).
Advertisements

Written by Necoro

October 10, 2009 at 02:26

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: