Subject: Re: git-svn merge helper

From: Steven Walter <[email-masked]>
Date: Tue, 2 Oct 2007 18:04:58 -0400

On Tue, Oct 02, 2007 at 11:14:00PM +0200, Björn Steinbrink wrote:
> One common pattern in SVN is to have the feature branch following the
> trunk. In git terms, that would mean that the feature branch is
> continually rebased onto the HEAD of the HEAD AFAICT (although SVN of
> course cannot represent that). The problem with that is, that git
> doesn't create a merge commit in that case and git-svn gets confused
> again.
> 
> git checkout mybranch
> git merge master # Creates a merge commit
> git checkout master
> git merge mybranch # Does just fast forward
> 
> Is there anyway to force a merge commit or some other work around?

When I want to do something like this, I go about it one of two ways.
The first option is to simply rebase mybranch onto master.  Since my
feature branches are not usually published, there is no problem
rewinding them.  That may not be an option for you, however.

The other option is to have a "build" branch.  By example:

git checkout build
git reset --hard master
git merge mybranch
make

In that way, I have branch with the latest changes from head and the
changes from mybranch together.  The downside to this method is that you
may have to repeated resolve merges.  Despite the downsides, I find
these two methods to work quite well.
-- 
-Steven Walter <[email-masked]>
"A human being should be able to change a diaper, plan an invasion,
butcher a hog, conn a ship, design a building, write a sonnet, balance
accounts, build a wall, set a bone, comfort the dying, take orders,
give orders, cooperate, act alone, solve equations, analyze a new
problem, pitch manure, program a computer, cook a tasty meal, fight
efficiently, die gallantly. Specialization is for insects."
   -Robert Heinlein