I understand that you push a tag by running:
git push origin v0.1.0
Where v0.1.0 is the name of the tag I created. I am looking for a command that just pushes the last tag I created, without needing to specify the number/name of the tag.
I understand that you push a tag by running:
git push origin v0.1.0
Where v0.1.0 is the name of the tag I created. I am looking for a command that just pushes the last tag I created, without needing to specify the number/name of the tag.
If you're creating a tag
at the HEAD, you'll do something like:
git tag <tagName>
If you use bash, on the very next terminal command you can do:
git push origin !$
!$
referes to the last word of the last command, which in this case will be your <tagName>
.
In general, you can get the list of sorted tags like this:
git tag --sort=creatordate
Using that, you can push your last tag like this:
git push origin $(git tag --sort=creatordate | tail -n 1)