git tag specific commit code example

Example 1: git commit and tag

git tag -a v1.0 7cceb02 -m "Your message here"

Example 2: git tag a previous commit

git tag -a v1.2 9fceb02 -m "Message here"

Example 3: git tag from commit

$ git tag <tag_name> HEAD   (for the last commit)

Example 4: git create tag and push

git tag <tagname>

Example 5: git commit and tag

git add .
git commit -m "some description"
git tag v0.1.9 # or any other text
git push origin master # push the commit
git push --tags origin # push the tags