Git/TortoiseGit : how to apply ONLY the changes from ONE commit from branch A, to branch B?

23 Views Asked by At

I got 2 branches that have lots of differences. I want to select a commit in branch A and apply ONLY the changes, introduced by this specific commit, to branch B.

For example, imagine we've got only one file in branches A and B:

  • In branch A, this file has 3 changes, introduced by commits: X, Y and Z
  • In branch B, this file hasn't changed at all
  • I want to get only the changes, introduced by the Z commit from branch A and apply them to the same file in branch B

Cherry-picking isn't helping me, since if I cherry-pick the Z commit from branch A into branch B - it gets the X and Y changes as well. And I do NOT want to review and edit each change by hand (so --no-commit ain't helping me either).

I'm using TortoiseGit, but don't mind using the Git bash.

Tried to use cherry-picking and patching, to no avail.

0

There are 0 best solutions below