Last active
August 2, 2023 12:34
-
-
Save ungerik/df20d661a19e06ae1f0e357df71adea1 to your computer and use it in GitHub Desktop.
Squashed Git Rebase
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
#!/bin/bash | |
git checkout -b temp main && git merge --squash $PR_BRANCH | |
# Resolve merge conflicts, then | |
git commit -m "my squash commit message" | |
git checkout $PR_BRANCH | |
git reset --hard temp && git push -f && git branch -D temp |
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
#!/bin/bash | |
git checkout -b temp master && git merge --squash $PR_BRANCH | |
# Resolve merge conflicts, then | |
git commit -m "my squash commit message" | |
git checkout $PR_BRANCH | |
git reset --hard temp && git push -f && git branch -D temp |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment