From eca37c02a642d4a426f70399cf7a2bb897b503f4 Mon Sep 17 00:00:00 2001 From: lindani Date: Sun, 2 Aug 2026 12:04:05 +0200 Subject: [PATCH] =?UTF-8?q?Fix=20squash=20command=20in=20cheat=20sheet=20(?= =?UTF-8?q?HEAD~6=20=E2=86=92=20HEAD~5)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Hi there, I'm learning Git and found this while playing around in my terminal. The heading says "Squash the last 5 commits into one," but the command used git rebase -i HEAD~6, which lists 6 commits instead of 5. In a repo with only 6 total commits, this actually throws fatal: invalid upstream HEAD~6, since there's no commit further back than the root. Changed it to HEAD~5 to match the heading and the actual number of commits being squashed. --- content/cheat-sheet/_index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/cheat-sheet/_index.html b/content/cheat-sheet/_index.html index cea6851f91..c68fd9902b 100644 --- a/content/cheat-sheet/_index.html +++ b/content/cheat-sheet/_index.html @@ -244,7 +244,7 @@

"Undo" the most recent commit (keep your working directory the same):

Squash the last 5 commits into one:

- git rebase -i HEAD~6 + git rebase -i HEAD~5

Then change "pick" to "fixup" for any commit you want to combine with the previous one