Basic Knowledge
Caption
When releasing a version, we usually first tag it in the repository, so that the version at the moment of tagging is uniquely determined. Whenever in the future, taking the version of a certain tag is to take out the historical version of the moment when the tag was tagged. So, tags are also a snapshot of the repository.
Although a Git tag is a snapshot of the repository, it is actually a pointer to a commit (similar to a branch, right? But a branch can be moved, but a tag cannot be moved), so creating and deleting tags is done instantly.
Git has commits, so why introduce tags?
because……
“Please package and release the version from last Monday, the commit number is 6a5819e...”
“A bunch of messy numbers are hard to find!”
If you do it another way:
“Please package and release the version from last Monday, the version number is v1.2”
“OK, just search for the commit according to tag v1.2!”
Therefore, a tag is a meaningful name that is easy to remember, and it is tied to a commit.