Skip to content

Instantly share code, notes, and snippets.

@zathomas
Created August 12, 2011 17:34
Show Gist options
  • Save zathomas/1142524 to your computer and use it in GitHub Desktop.
Save zathomas/1142524 to your computer and use it in GitHub Desktop.
This automates the process of creating a new tag based on today's date.
#!/bin/sh
version="1.0"
date=`date "+%Y%m%d"`
git checkout -b $version-$date-branch
sed "s/$version-SNAPSHOT/$version-$date/" pom.xml > pom.xml.new
mv pom.xml.new pom.xml
git add pom.xml
git ci -m "changing version number for tag"
git tag -m "tagging $version-$date" $version-$date HEAD
git push origin $version-$date
@zathomas
Copy link
Author

It might be good to add a couple of lines to checkout back to whatever branch you were in when you started, and then delete the new date branch, which is a throwaway.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment