git tag example

Example 1: git create tag and push

git tag -a v1.4 -m "my version 1.4"

Example 2: how to create tag in git

git tag -a v1.4 -m "my version 1.4"

Example 3: git add tag

git tag -a v1.2 
git push origin v1.2

Example 4: create a tag from a commit/branch

git tag -a version.number -m "Tag Message"
git push origin <tagname>

Example 5: git create tag and push

$ git push origin v1.4
Counting objects: 14, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (12/12), done.
Writing objects: 100% (14/14), 2.05 KiB | 0 bytes/s, done.
Total 14 (delta 3), reused 0 (delta 0)
To [email protected]:atlasbro/gittagdocs.git
* [new tag] v1.4 -> v1.4

Example 6: search tag git

$ git tag -l "v1.8.5*"
v1.8.5
v1.8.5-rc0
v1.8.5-rc1
v1.8.5-rc2
v1.8.5-rc3
v1.8.5.1
v1.8.5.2
v1.8.5.3
v1.8.5.4
v1.8.5.5