3

I have a not yet published local repo with graph structure like this:

*   G 
*   F
|\
| * E
| * D
* | C: A minor fix -- SQUASHME  
* | B
|/
*   A

So I want to squash commits B and C into a single commit, keeping (I suspect it'll take recreating/rewriting commits to keep) this graph structure with its branching and merging points.

Any pointers?

Igor S.K.
  • 999
  • 6
  • 17

1 Answers1

1
git rebase -i A -p

then use fixup or squash stanza for C, depending on whether you want to use the commit message of B or want to edit it.

Note: Without the -p parameter the merges will be transformed into linear history.

Vampire
  • 35,631
  • 4
  • 76
  • 102