Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why do so many projects prepend "v" to the git version tags?

A lot of projects (e.g. Linux) prepend v to their git version tags, e.g. v3.19 which makes parsing of those tags harder for no obvious reason. What's the sense of doing that?

like image 800
Kalle Richter Avatar asked Feb 19 '15 12:02

Kalle Richter


People also ask

Why should you use git tags?

Tagging is generally used to capture a point in history that is used for a marked version release (i.e. v1. 0.1). A tag is like a branch that doesn't change. Unlike branches, tags, after being created, have no further history of commits.

Which tag is recommended for saving a final version of project?

Annotated Tags If you are pointing and saving a final version of any project, then it is recommended to create an annotated tag.

How do I manage version numbers in git?

Using Git to Create a Version NumberThe git describe command returns the latest tag on the current branch. If additional commits have been made after the tag, the tag name is suffixed with the number of additional commits and the hash of the tip commit.

What is considered as best practice while creating annotated tags?

In the previous example, we created a lightweight tag. Lightweight tags and Annotated tags differ in the amount of accompanying metadata they store. A best practice is to consider Annotated Tags as public, and Lightweight Tags as private. Annotated tags store extra metadata such as the tagger name, email, and date.


1 Answers

As mentioned in "Is there a standard naming convention for git tags?":

The reason for the preceding 'v' is historical.
Older SCCS (cvs,rcs) could not distinguish between a tag identifier and a revision number.
Tag identifiers were restricted to not begin with a numeric value so that revision numbers could be detected.

That convention is not enforced with Semantic Versionning in its 2.0 revision. It was in its 1.0 revision:

When tagging releases in a version control system, the tag for a version MUST be "vX.Y.Z" e.g. "v3.1.0".

The fact it is no longer enforced shows how optional that 'v' can be.

like image 58
VonC Avatar answered Oct 14 '22 03:10

VonC