Skip to content

Instantly share code, notes, and snippets.

@tristanlins
Last active July 10, 2017 21:13
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save tristanlins/203e3bca25dfe001c9d8 to your computer and use it in GitHub Desktop.
Save tristanlins/203e3bca25dfe001c9d8 to your computer and use it in GitHub Desktop.
Quick creation of new releases with git flow, without using the release branch.
#!/bin/bash
TAG=$1
if [[ -z "$TAG" ]]; then
echo "No tag specified!"
exit 1
fi
if [[ -n "$(git status --porcelain)" ]]; then
echo "Uncommited changes detected!"
git status -s
exit 1
fi
echo "Release version $TAG"
git checkout develop && \
git pull -r && \
git checkout master && \
git pull -r && \
git checkout develop && \
git checkout -b "release/$TAG" develop && \
git checkout master && \
git merge --no-ff "release/$TAG" && \
git branch -d "release/$TAG" && \
git tag -s -m "Version $TAG" "$TAG" && \
git checkout develop && \
git merge --no-ff "$TAG"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment