Skip to content

Fix squash command in cheat sheet (HEAD~6 → HEAD~5) - #2192

Open
lindanigs wants to merge 1 commit into
git:gh-pagesfrom
lindanigs:fix-cheat-sheet-squash-head
Open

Fix squash command in cheat sheet (HEAD~6 → HEAD~5)#2192
lindanigs wants to merge 1 commit into
git:gh-pagesfrom
lindanigs:fix-cheat-sheet-squash-head

Conversation

@lindanigs

Copy link
Copy Markdown

Changes

  • Fixed the squash example in the cheat sheet: git rebase -i HEAD~6git rebase -i HEAD~5

Context

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.

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant