February 15, 2025

Git: merge the last two commits into one commit

Run:

$ git rebase --interactive HEAD~2

The lowest commit in the list is the latest.

Substitute pick by squash.

pick old_commit
squash newest_commit

Save.

That should take you to another editor screen.

If not, if you are back on the command line, run:

git rebase --continue 

to carry on.


personal computing command-line interface (cli) gnu linux trisquel shell literacy office applications wiki

No affiliate links, no analytics, no tracking, no cookies. This work © 2016-2025 by yctct is licensed under CC BY-SA 4.0 .   about me   contact me   all entries & tags   FAQ   GPG public key

GPG fingerprint: 2E0F FB60 7FEF 11D0 FB45 4DDC E979 E52A 7036 7A88