Today I Learned

hashrocket A Hashrocket project

Tag a Commit

I ❤️ Git tags. But tagging is a manual process, and sometimes I forget to do it.

My old solution was to find the commit I deployed, check it out, tag it, and push the tags to the internet. There is a better way!

You can tag any commit from anywhere in the tree:

$ git tag v1.0.0 a795622
$ git push --tags

This will tag commit a795622 and push it to Github. A sample workflow, if your deploy was one commit in the past, would be:

$ git tag v1.0.0 HEAD~1
See More #git TILs