Skip to main content
must be HEAD, emphasize "squash" with optional abbreviation
Source Link
mkrieger1
  • 21.8k
  • 5
  • 61
  • 74
git rebase -i head~6HEAD~6

Then in the interactive editor put ssquash (for squashyou can abbreviate to s) in front of the commits you want to squash and leave the others as pickpick.

Example:

pick 043af87 message
s    8c0fa0e message
s    b6c7116 message
pick c5d91a3 message
pick f20898f message
pick edcbad2 message
git rebase -i head~6

Then in the interactive editor put s (for squash) in front of the commits you want to squash and leave the others as pick.

Example

pick 043af87 message
s    8c0fa0e message
s    b6c7116 message
pick c5d91a3 message
pick f20898f message
pick edcbad2 message
git rebase -i HEAD~6

Then in the interactive editor put squash (you can abbreviate to s) in front of the commits you want to squash and leave the others as pick.

Example:

pick 043af87 message
s    8c0fa0e message
s    b6c7116 message
pick c5d91a3 message
pick f20898f message
pick edcbad2 message
Source Link
Journey
  • 1.1k
  • 1
  • 9
  • 12

git rebase -i head~6

Then in the interactive editor put s (for squash) in front of the commits you want to squash and leave the others as pick.

Example

pick 043af87 message
s    8c0fa0e message
s    b6c7116 message
pick c5d91a3 message
pick f20898f message
pick edcbad2 message