List all the tags in the repository:
git tag
List tags with a specific pattern:
git tag -l "v1.0.*"
git tag <tagname>
Example:
git tag v1.0.0
git tag -a <tagname> -m "<tag message>"
Example:
git tag -a v1.0.0 -m "Release version 1.0.0"
git tag -a <tagname> <commit-hash> -m "<tag message>"
Example:
git tag -a v1.0.0 9fceb02 -m "Release version 1.0.0"
git push <remote> <tagname>
Example:
git push origin v1.0.0
git push <remote> --tags
Example:
git push origin --tags
git checkout <tagname>
Example:
git checkout v1.0.0
git tag -d <tagname>
Example:
git tag -d v1.0.0
git push <remote> --delete <tagname>
Example:
git push origin --delete v1.0.0
Show information about a specific tag:
git show <tagname>
Example:
git show v1.0.0
Create a signed tag (if you have a GPG setup):
git tag -s <tagname> -m "<tag message>"
Example:
git tag -s v1.0.0 -m "Signed release version 1.0.0"
Verify tags are signed and valid:
git tag -v <tagname>
Example:
git tag -v v1.0.0
Note: Always use annotated tags for marking releases or important points in history as they are checksummed and can include additional information.