Re: applying a patch to 2 branches



On Wed, Apr 22, 2009 at 6:43 AM, Dr. Michael J. Chudobiak
<mjc avtechpulse com> wrote:
> Hi all,
>
> Can someone explain the "proper way" to apply a patches to both a stable
> branch and the master branch, using git?
>
> With svn, I would commit the patches to the stable branch (say as commits
> 124 and 125), then go to the trunk branch, then use something like "svn
> merge -r 123:125 /path/to/stable/branch", and commit from trunk.
>
> I'm struggling to understand the equivalent in git. Perhaps it's obvious,
> just not to me...

You should be able to cherry pick the patch out of the devel branch
after committing it and then checking out the stable branch.

If you have several patches from different branches you would like to
apply to the stable branch with 1 commit, you can collapse them all
with something like this:

 git cherry-pick -x --no-commit 2357132f4670debfcbd16869c78c0e271d3d0f65
 git cherry-pick -x --no-commit 2357132f4670debfcbd16869c78c0e271d3d0f65

Look at the diffs and then commit that. Is this what you were looking for?

-- 
Jeff Schroeder

Don't drink and derive, alcohol and analysis don't mix.
http://www.digitalprognosis.com


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]