It is a good idea to add tags to specific commits.
Tag overview
git tag : show all tags |
Add an annotated tags: recommended
Annotated tags are stored as full objects in the Git database. Containing the tagger name, email, date, have a tagging message.
git tag -a v3.1.0 -m "Release 3.1.0" : add an annotated tag to current commit with message git tag -a v3.1.0 -m "Release 3.1.0" SHA : add an annotated tag to a commit with SHA and add message |
Adding a simple tag: not recommended
A simple tag is very much like a branch, but it doesn’t change location and is fixed to one commit.
git tag v3.01 : add a simple tag to current commit git tag v3.01 SHA : add a simple tag to commit with SHA |
It is recommended to use the “-a” option for annotated tags.
Push a tag
By default, the git push command doesn’t transfer tags to remote servers. You will have to explicitly push tags to a shared server.
git push origin <tagname> git push origin v3.1.0 |