Skip to content

Instantly share code, notes, and snippets.

@visitbethel
Created May 11, 2017 19:18
Show Gist options
  • Save visitbethel/3a6bcbed9d6852b4f9b4d4cdba1e8a8b to your computer and use it in GitHub Desktop.
Save visitbethel/3a6bcbed9d6852b4f9b4d4cdba1e8a8b to your computer and use it in GitHub Desktop.
release script for git with maven versions plugin
// Make release branch:
git checkout -b release-1.0
// Set release version:
mvn versions:set -DnewVersion=1.0
mvn versions:commit
// Push changes to release branch:
git add .
git commit -m "Set release version to 1.0"
git push
// Create tag:
git tag -a v1.0 -m "Application v1.0"
// Push tag to remote repository:
git push --tags
// Move to master branch:
git checkout master
// Delete the release branch:
git branch -D release-1.0
// Check that branch is deleted:
git branch -a
// Set new working version to master/develop:
mvn versions:set -DnewVersion=1.1-SNAPSHOT
mvn versions:commit
// Push version changes:
git add .
git commit -m "Changed working version to 1.1-SNAPSHOT"
git push
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment