Created
June 19, 2018 09:42
-
-
Save schaechinger/891271b4156ce994edf29f292a3a58d7 to your computer and use it in GitHub Desktop.
Squash all changes of a feature branch to create pull requests with one single commit.
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/sh | |
git fetch | |
branch=$(git symbolic-ref -q HEAD) | |
branch=${branch##refs/heads/} | |
branch=${branch:-HEAD} | |
default=$(git symbolic-ref refs/remotes/origin/HEAD | sed 's@^refs/remotes/origin/@@') | |
git rebase -i origin/$default | |
git push origin +$branch |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment