Git tags
If you reach an important stage and want to always remember that particular commit snapshot, you can tag it with git tag.
For example, we want to release a "1.0" version of our W3CSCHOOLCC project. We can use git tag-a v1.0 command to label the last commit (head) "v1.0".
The-a option means "create a label with annotations." It can be done without the-a option, but it will not record when the tag was played, who hit it, and would not let you add a label annotation. I recommend that you always create labels with annotations.
$ git tag-a v1.0
When you execute the git tag-a command, Git opens your editor and lets you write a tag annotation, just as you would for submitting a note.
Now, notice that when we execute git log--decorate, we can see our tags:
$ git log--oneline--decorate--graph
* 88afe0e (head, tag:v1.0, master) Merge branch ' change_site '
|\
| * D7E7346 (Change_site) changed the site
* | 14B4DCA new Add line
|/
* 556f0a0 removed test2.txt
* 2e082b7 add Test2.txt
* 048598f add test.txt
* 85fc7e7 test comment from w3cschool.cc
If we forget to label a submission and publish it again, we can tag it.
For example, suppose we publish the submission 85fc7e7 (the last line of the example above), but forgot to label it at the time. We can now also:
$ git tag-a v0.9 85fc7e7
$ git log--oneline--decorate--graph
* 88afe0e (head, tag:v1.0, master) Merge Bra Nch ' change_site '
|\
| * d7e7346 (change_site) changed the site
* | 14B4DCA add a new line
|/
* 556f0a0 removed Test2.txt
* 2e082b7 add test2.txt
* 048598f add test.txt
* 85FC7E7 (tag:v0.9) test comment from W3cschool. Cc
If we want to view all tags, we can use the following command:
$ git tag
v0.9
v1.0
Specify label Information command:
Git tag-a <tagname>-M "w3cschool.cc label"
PGP Signature Label Command:
Git tag-s <tagname>-M "w3cschool.cc label"