5

What non-interactive git command(s) achieve the change from Before to After (where BC is a merge commit)

Before:

A---B---C---D

After:

  B---C
 /     \
A-------BC---D'

1 Answer 1

5

Here's what I'd do:

$ git branch to-merge-in C-commit-ID    # Create a branch at C
$ git reset --hard A-commit-ID          # Reset current branch to A
$ git merge --no-ff to-merge-in         # Merge in branch. Create a merge commit.
$ git cherry-pick D-commit-ID           # Grab the commit D

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.