Created
June 12, 2018 15:26
-
-
Save droberson/0eddca819764cffd56532d461bcb7b3d to your computer and use it in GitHub Desktop.
Squashing multiple 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
1. git checkout -b squashed_branch | |
2. git rebase -i master | |
3. edit the file: | |
pick aaaaaaa commit message 1 | |
pick bbbbbbb commit message 2 | |
pick ccccccc commit message 3 | |
... | |
-> | |
pick aaaaaa commit message 1 | |
squash bbbbbb commit message 2 | |
squash cccccc commit message 3 | |
... | |
4. if conflicts arise: | |
- git status ### see which file is messed up | |
- edit the affected file appropriately | |
- git add . ### git rm if you dont want the file anymore | |
- git rebase --continue | |
- repeat until no more conflicts |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment