Created
October 22, 2015 14:17
-
-
Save yitsushi/6e625e67d316a8e01c04 to your computer and use it in GitHub Desktop.
Auto tag working directory before staging. Useful to quick revert if the new codebase failed (build server? Test? use them instead :D).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/sh | |
| git fetch --tags && \ | |
| git tag | \ | |
| grep "autotag-`date +"%Y%m%d"`" > /dev/null \ | |
| || git tag "autotag-`date +"%Y%m%d"`" -m 'autotag' \ | |
| && git tag "autotag-`date +"%Y%m%d"`-"$((`git tag | sort -n | tail -n 1 | sed -Ee 's/autotag-[0-9]{8}-?([0-9]*)/\1/g'` + 1)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment