-
-
Save landsman/d9d2b5fd03b0a3fff0c26603f3360987 to your computer and use it in GitHub Desktop.
git squash last two commits into one
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
git rebase --interactive HEAD~2 | |
# we are going to squash c into b | |
pick b76d157 b | |
pick a931ac7 c | |
# squash c into b | |
pick b76d157 b | |
s a931ac7 c | |
# after that just edit the commit message | |
# This is a combination of 2 commits. | |
# The first commit's message is: | |
b | |
# This is the 2nd commit message: | |
c |
I'm curious what's the difference between the way you posted above with following?
git reset --soft HEAD~2
git commit -m "New message for the combined commit"
git push origin +name-of-branch
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
git rebase --interactive HEAD~2