Freeman, Douglas Stuart

Default profile image

Codito ergo sum.

How I track the maintenance branch in git

Dec 23, 2008 10:35 AM Publicly Viewable

There's been a lot of interest in git recently, so I thought I'd share how we're using it to keep up with the maintenance branch.  Our "central git server" keeps a set of branches with the prefix "remote-" that comes from svn, and is updated nightly.  We then have a tsquare-2.5.x branch that we tag and build from that's based on remote-sakai-2.5.x.  So when I'm ready to catch a submodule up to the latest 2.5.x, I just cd into its directory and 'git merge remote-sakai-2.5.x'.  This is interesting because it keeps the order that we commit our local changes and merge the upstream fixes.  I've thought about other ways of doing this like making a new branch from the current tsquare branch and rebasing it to remote-sakai-2.5.x as that would keep our local changes stacked on the end, and would probably make it easier to do larger changes like switching to 2.6.x.  Stgit appears to do something similar and may even fit our model better, but I haven't had a lot of time to investigate it yet.

Why merge tracking rocks

Apr 24, 2008 2:35 PM Publicly Viewable

I'm playing around with git and git-svn (which lets you work bidirectionally with an svn repository from git).  Svn only tracks when you branch, but git tracks both when you branch and when you merge.  At first this doesn't sound like a big deal, but what it allows is merging an entire branch with a simple command.  So, lets say I'm working on a branch called 'experimental_features' and the community is making bugfixes in trunk.  Well now I want those trunk changes in my branch so that when I'm done with my cool new features they merge back to trunk cleanly.  In svn I'd have to track down when the last time I merged from trunk was and what the current trunk revision is then do my merge specifying that info and making a note so that I can do it again next time.  Git allows me to just say 'git merge trunk', because it knows when I last merged it does all the bookkeeping for me.   Now it turns out that my experimental_features branch is actually a clone of an svn repo, so I can check all this back in with a simple 'git svn dcommit'.