-
-
Save chrisolsen/fa6b4d7fa952a1f04feb20bddb34e60f to your computer and use it in GitHub Desktop.
git commit and squash to PR branch
This file contains hidden or 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 branch | grep "\*" | cut -d " " -f 2 | { | |
read br | |
git checkout -B pr-$br | |
git reset --soft master | |
git commit -m "$1" | |
echo "pushing to pr-$br..." | |
git push origin "pr-$br" -f | |
git checkout $br | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment