Freeman, Douglas Stuart

Default profile image
Freeman, Stuart

Codito ergo sum.

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