Created
November 27, 2016 23:23
-
-
Save seveibar/6b7877958d44cef7318f31011ac6344d to your computer and use it in GitHub Desktop.
If you prefer to always work in a detached head state, this will allow you to quickly do a PR and return to master w/o creating branches
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 checkout -b $1 | |
git push origin $1 | |
hub pull-request | |
read -p "back to master? <y/N> " prompt | |
if [[ $prompt == "y" || $prompt == "Y" || $prompt == "yes" || $prompt == "Yes" ]] | |
then | |
git fetch | |
git checkout origin/master | |
else | |
git checkout HEAD^1 | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment