Skip to content

Instantly share code, notes, and snippets.

@workingmonk
Last active June 4, 2019 17:50
Show Gist options
  • Save workingmonk/f9e8feeabdb33f075f3adf61bc980cd3 to your computer and use it in GitHub Desktop.
Save workingmonk/f9e8feeabdb33f075f3adf61bc980cd3 to your computer and use it in GitHub Desktop.
Simple script to tag git repo with current date
#!/bin/bash
# This will create a tag "PROD_2018.09.05" with the message "Production deploy tag for September 05 2018"
# Example: https://github.com/SmartThingsCommunity/SmartThingsPublic/releases/tag/PROD_2018.09.05
tagDate=`date +%Y.%m.%d`
infoDate=`date +%B\ %d\ %Y`
tag="PROD_$tagDate"
echo $tag
git checkout production
git pull
git tag -a $tag -m 'Production deploy tag for $infoDate'
git show $tag
@workingmonk
Copy link
Author

workingmonk commented Sep 25, 2018

git checkout production && git pull && git tag -a PROD_2019.03.05 -m 'Production deploy tag for March 5, 2019' && git show PROD_2019.03.05 && git push origin PROD_2019.03.05

@workingmonk
Copy link
Author

run the commands on repo clones not forks

@workingmonk
Copy link
Author

workingmonk commented Apr 9, 2019

git checkout production && git pull && git tag -a PROD_2019.06.04 -m 'Production deploy tag for June 4, 2019' && git push origin PROD_2019.06.04

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