Skip to content

Instantly share code, notes, and snippets.

@jberndsen
Created November 20, 2019 12:12
Show Gist options
  • Save jberndsen/f7bdf8ce7ac5811a80675835351f3188 to your computer and use it in GitHub Desktop.
Save jberndsen/f7bdf8ce7ac5811a80675835351f3188 to your computer and use it in GitHub Desktop.
set -e
CURRENT_BRANCH=$(git branch | grep \* | cut -d ' ' -f2)
if [[ "$CURRENT_BRANCH" == "develop" ]]
then
git pull
REL=$(npm --no-git-tag-version version minor | sed 's/^v//')
git checkout -b release/$REL
git add package.json package-lock.json
git commit -m'release branch created'
git push --set-upstream origin release/$REL
else
echo " ! can create from 'develop' branch only ! "
exit 1
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment