Last active
June 5, 2020 17:13
-
-
Save luiarthur/9586618edec5b6289cdb13256a7c3a6e to your computer and use it in GitHub Desktop.
Merge and squash a git branch
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
# Say you are working on a branch called `my-branch` | |
# and you wish to now merge it into `master`, and | |
# squash all commits from `my-branch` into one commit. | |
# You can do the following: | |
git checkout master | |
git merge --squash my-branch | |
git commit | |
# You will then be placed in an editor with all your previous | |
# commits. First, add a one-liner at the top. Then, feel free | |
# to rewrite or remove the previous commit logs. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment