Created
May 14, 2018 00:52
-
-
Save mkanenobu/e16ba1ae546425c11a57de84458b88be to your computer and use it in GitHub Desktop.
git push current branch
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 | |
current_branch="$(git branch | grep \* | sed -e "s/\*\ //")" | |
echo "Push to $current_branch" | |
if [ "$current_branch" = "master" ]; then | |
read -rp "Are you sure?:" confirm | |
if [ "$confirm" = "y" ]; then | |
git push origin master | |
else | |
echo "" | |
fi | |
else | |
git push origin "$current_branch" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment