4

I forgot to check the option interactive when rebasing a branch. I need one final commit but instead I have N commits on master. Is it possible to squash commits after the rebase process was finished?

Amio.io
  • 19,167
  • 13
  • 76
  • 107

1 Answers1

6

Yes you can rebase them again. Use the following command for an interactive rebase:

git rebase --interactive <commit-id>

Where <commit-id> is the last commit you want unchanged. After that an editor will show up. Change all the pick commands to squash for the commits you want squashed into one.

Johannes Thorn
  • 882
  • 6
  • 13