Created
September 22, 2014 23:31
-
-
Save unclecheese/42b3a2be84f931299e39 to your computer and use it in GitHub Desktop.
Bash script for creating new hotfix 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/sh | |
CURRENT_BRANCH=$(git rev-parse --abbrev-ref HEAD) | |
if [ "$CURRENT_BRANCH" != "master" ];then | |
echo $CURRENT_BRANCH | |
echo "Please switch to the master branch to start a new feature." | |
exit | |
fi | |
echo "What is the name of this feature (e.g. my-feature-name)? " | |
read FEATURE_NAME | |
git checkout -b "feature/$FEATURE_NAME" | |
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 | |
CURRENT_BRANCH=$(git rev-parse --abbrev-ref HEAD) | |
if [ "$CURRENT_BRANCH" != "master" ];then | |
echo $CURRENT_BRANCH | |
echo "Please switch to the master branch to start a new hotfix." | |
exit | |
fi | |
echo "What is the name of this hotfix, e.g. the JIRA card number? " | |
read HOTFIX_NAME | |
git checkout -b "hotfix/$HOTFIX_NAME" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment