How to use the throw away test branch strategy for syncing long lived feature branches?

I was reading this blog post on git which talks about various branching strategies. The article recommend that for long lived feature branches one should keep merging from master into the feature branches to keep the feature branch in sync with master so that when feature branch gets merged back into master it won’t be problematic. This strategy is clear to me. In comments Junio Hamano the git mainter says.

I would have to caution that “branch out and sync often” is a
disease to be avoided. You branched to achieve a specific goal (e.g.
“add this feature”, “fix this bug”) and the point of having a
dedicated branch for that task is to keep the history of that
particular branch readable and understandable, which will lead to less
bugs. It will defeat the point of using a separate branch if you
randomly merge back from “master” at the point where the work on your
branch is not yet ready, and whatever was done on “master” does not
affect what the specific goal of adding the feature or fixing the bug.

The standard recommendation to avoid the disease, while making sure
that the time-consuming work you are doing on your branch that was
forked while ago still does work well with the random work done by
others, is to make a throw-away “test” branch that merges from your
topic branch and the master branch to keep the codebase-drift in

My question how does throw-away test branch strategy work, how does it make the final integration with master easier? Can anyone provide a more detailed example / easier to understand explanation?

  • SVN to Git migration - undefined author, but it is
  • Are concurrent git pushes always safe if the second push only has fast-forwards from the first push?
  • Git: How to merge local branch with remote tracking automatically without fetching
  • git commit modified and untracked content
  • Heroku deployment, git remote not added
  • svn2git with --exclude, any way to ignore the empty/blank commits?
  • Use Git list output to copy files for archiving
  • How can I limit the log to commits that affected a given path, but see *all* the changes made in those commits?
  • One Solution collect form web for “How to use the throw away test branch strategy for syncing long lived feature branches?”

    I found the detailed explanation of this pattern at Junio Hamano’s blog Fun with ReReRe .

    The basic idea is to do a test merge on a branch that will not be kept and then use the rerere feature of git to record how conflicts are resolved then, throw away the test merge branch, and when final merging occurs the recorded merge resolutions will be automatically applied by git.

    Git Baby is a git and github fan, let's start git clone.