-
-
Save darkgeek/8dae4a59cf1b6b5fc87e to your computer and use it in GitHub Desktop.
Git merge commits
This file contains 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
# Suppose we have this history: | |
$ git log --oneline | |
2750b94 Finally fix bug #84. | |
da52aaa Fix bug #84. | |
31f5476 Fixing bug #84. | |
# We enter rebasing with: | |
git rebase --interactive HEAD~3 | |
# HEAD~3 says from HEAD include 3 commits | |
# Our editor will open with: | |
pick 31f5476 Fixing bug #84. | |
pick da52aaa Fix bug #84. | |
pick 2750b94 Finally fix bug #84. | |
# Update the file as follow: | |
pick 31f5476 Fixing bug #84. | |
squash da52aaa Fix bug #84. | |
squash 2750b94 Finally fix bug #84. | |
# Now quit and save, | |
# you will be prompted to enter a new commit message. | |
# Your new log history will be: | |
$ git log --oneline | |
38c0f13 Your new commit message about bug #84. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment