Fix squash command in cheat sheet (HEAD~6 → HEAD~5) - #2192
Open
lindanigs wants to merge 1 commit into
Open
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changes
git rebase -i HEAD~6→git rebase -i HEAD~5Context
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 throwsfatal: invalid upstream 'HEAD~6', since there's no commit further back than the root.Changed it to
HEAD~5to match the heading and the actual number of commits being squashed.