Created
November 7, 2014 11:20
-
-
Save OndrejP/9401f9fdd50413447e0c to your computer and use it in GitHub Desktop.
Short way to create release tag
This file contains 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
function git.releaseID { | |
test $(date --reference=${HOME}/.git.releaseid +"%j" 2>/dev/null || echo 389) -ne $(date +"%j") \ | |
&& echo -n 1 >~/.git.releaseid \ | |
|| echo $(($(cat ~/.git.releaseid)+1)) >~/.git.releaseid ; | |
cat ~/.git.releaseid ; | |
} | |
function WikidiRelease { | |
r=$(date +"%Y%m%d").$(git.releaseID); | |
git tag release/$r; | |
git push origin release/$r; | |
} |
function WikidiRelease {
d="release/"`date +"%Y%m%d"`;
r=$((`git tag -l "$d*" | sort -rV | head -1 | sed -n "s@^$d\.@@p" || echo 0`+1))
git tag $d.$r;
git push origin $d.$r;
}
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
function WikidiRelease {
d="release/"
date +"%Y%m%d"
;r=$((
git tag -l "$d*" | sed -n 's/^.*\.\([0-9]\+\)$/\1/p' | sort -n | tail -n 1 || echo 0
+1))git tag $d.$r;
git push origin $d.$r;
}