threads / discuss / 20163

local configuration

Subject: local configuration

## tl;dr

4 messages between Jul 20, 2009 and Jul 22, 2009.

replies: 3people: 4as markdown or json

Roald de Vries· Jul 20, 2009, 10:54 UTC · lore
Hi all,

I want to use git to synchronize my bashrc's (and other configuration files) between computers. These have common stuff in them, and stuff that's specific to a certain computer. The way I do it now is with a branch for each computer, and one common branch. Is this a known use case, am I misusing git, and is there a more elegant way to do this?

Thanks in advance for replies, kind regards, Roald
Nicolas Sebrecht· Jul 20, 2009, 11:47 UTC · re: Roald de Vries · lore

Re: local configuration

The 20/07/09, Roald de Vries wrote:
Show 5 quoted lines
> I want to use git to synchronize my bashrc's (and other configuration  
> files) between computers. These have common stuff in them, and stuff  
> that's specific to a certain computer. The way I do it now is with a  
> branch for each computer, and one common branch. Is this a known use  
> case, am I misusing git, and is there a more elegant way to do this?

I try to write my conf files as portable as possible. Today, I don't need dedicated branches but that's the way I would achieve it.

-- 
Nicolas Sebrecht
Ben Walton· Jul 22, 2009, 01:21 UTC · re: Nicolas Sebrecht · lore

Re: local configuration

Excerpts from Nicolas Sebrecht's message of Mon Jul 20 07:47:57 -0400 2009:
> I try to write my conf files as portable as possible. Today, I don't
> need dedicated branches but that's the way I would achieve it.

I store all of my config in a single tree and have bash or emacs source files selectively after detecting various useful attributes of the system. For bash, this includes platform, 'domain' (site) and machine. For emacs, this includes version, flavour, etc. It makes for a bigger tree, but I can store it all easily and check it out anywhere.

-Ben
-- 
Ben Walton
Systems Programmer - CHASS
University of Toronto
C:416.407.5610 | W:416.978.4302

GPG Key Id: 8E89F6D2; Key Server: pgp.mit.edu
Contact me to arrange for a CAcert assurance meeting.
Tim Visher· Jul 20, 2009, 11:56 UTC · re: Roald de Vries · lore

Re: local configuration

Hi Roald,
On Mon, Jul 20, 2009 at 6:54 AM, Roald de Vries<rdv@roalddevries.nl> wrote:
Show 5 quoted lines
> I want to use git to synchronize my bashrc's (and other configuration files)
> between computers. These have common stuff in them, and stuff that's
> specific to a certain computer. The way I do it now is with a branch for
> each computer, and one common branch. Is this a known use case, am I
> misusing git, and is there a more elegant way to do this?

I'm using git for the same purpose. I don't think you're going to find anyone who will get too dogmatic here and say there are any universally wrong ways to use git. If it works for you, you should probably just keep doing it. However, I could tell you what I'm doing.

I use git to manage both my bash config files (.bashrc, .inputrc, .bash_profile) and my .emacs file (a tree .emacs.d). I manage these files for use on a Mac and a Windows Box running Cygwin. What I've done is I keep all common configuration items in one git repo with a single branch. If I'm working on something really large that will be broken for awhile, which is rare, then I'll branch out and go back to stable when I'm done working for the day. Once it's done, obviously, I merge it back in and delete the branch. Obviously, though, there is configuration that only belongs on one box or the other. For those, I have files that lie outside of my current repo that I call out to. I put them in the same relative locations on either box (obviously, Bash works the same on Cygwin and the Mac) and so my really local configuration lives on unbeknownst to my repo. If I can't locate that file outside of the repo (for instance, Emacs Easy Configuration file) then I use the .gitignore file to keep it out of my hair if there are items local to the box I'm on.

That then begs the question of how to track the local files. You can always make a new git repo. That's easiest to do if the files are outside of the current repo because you can just make a new repo. If the file has to reside in the common repo, then it's a little more complicated. You may be able to use sub-repos combined with .gitignore files? I haven't had occasion to work this out yet.

Hope that gives you some food for thought. Again, it's just how I happen to do things. Your approach sounds just as good to me.

/me shrugs.
-- 
In Christ,

Timmy V.

http://burningones.com/
http://five.sentenc.es/ - Spend less time on e-mail

← back to recent threads