1

If I execute git log, I see on the top two commits done by me. Each commit comes with its change ID.

Now I would like to squash this commit into one. It means that I want these two commits to come as one commit with one commit message.

Moreover, I want that the combined commit gets the Change ID from the last but one commit.

Roman
  • 124,451
  • 167
  • 349
  • 456
  • `git rebase -i` and use `pick` and `fixup` respectively when prompted for your two commits – Cory Kramer Dec 08 '17 at 13:22
  • What is the "Change ID"? Something in your commit message? So just use `squash` and edit the message to keep the parts you want from the two original commits' messages. – underscore_d Dec 08 '17 at 13:28
  • 1
    This question is a duplicate. Note that when you squash two commits, you will have the chance to edit the final commit message at which point you can make any changes you want w/r/t the change id embedded in the message. – larsks Dec 08 '17 at 13:34
  • Also, assuming by 'Change ID' you mean the `SHA` of the commit, you won't be able to have the new combined commit retain the `SHA` of either of the original ones; by necessity it will change because it's a new commit. – joel boonstra Dec 08 '17 at 15:27

0 Answers0