Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why GitHub suggest "prefix your version names with the letter v?"

Tags:

git

github

This is the content at GitHub's right sidebar:

Tagging suggestions It’s common practice to prefix your version names with the letter v. Some good tag names might be v1.0 or v2.3.4.

If the tag isn’t meant for production use, add a pre-release version after the version name. Some good pre-release versions might be v0.2-alpha or v5.9-beta.3.

Semantic versioning If you’re new to releasing software, we highly recommend reading about semantic versioning.

I don't understand why prefix your version names with the letter v? Please explain for me, why prefix version names with letter v is best-practice?

like image 974
Do Nhu Vy Avatar asked Jun 13 '16 02:06

Do Nhu Vy


People also ask

What is V prefix?

The word “Verified” (or the letter “V”) will appear next to some incoming calls on your caller ID, voicemail logs or TV screen (for Xfinity X1 customers). This will indicate that the call is coming from a phone number Comcast is able to verify.

Should git tags start with V?

No, “v1.2.3” is not a semantic version. However, prefixing a semantic version with a “v” is a common way (in English) to indicate it is a version number. Abbreviating “version” as “v” is often seen with version control. Example: git tag v1.2.3 -m "Release version 1.2.

What is semantic versioning GitHub?

Semantic release is a versioning tool that can compute semantic version numbers by reading commit messages. It can also generate release notes and publish packages to GitHub and NPM.


2 Answers

Most open source projects, and many tags on github and other open VCS sites, follow a format called Semantic Versioning, linked also in the quote in your question. This is the versioning model that suggests:

Given a version number MAJOR.MINOR.PATCH, increment the:

  1. MAJOR version when you make incompatible API changes,
  2. MINOR version when you add functionality in a backwards-compatible manner, and
  3. PATCH version when you make backwards-compatible bug fixes.

Additional labels for pre-release and build metadata are available as extensions to the MAJOR.MINOR.PATCH format.

The SEMVER recommendation has gone through a few revisions of its own, and at one point recommended prefacing a tag with a "v", but these days I believe it does not mention the practice. Nevertheless, many sites, projects and conventions have followed this former SEMVER practice, and haven't updated themselves to follow the newer recommendations.

My own opinion is that it probably doesn't matter whether you start your tags with a "v" or not. But you may have an easier time using tools like sort if you don't.

like image 128
ghoti Avatar answered Oct 22 '22 08:10

ghoti


One possible reason, you can easily filter on tags that start with 'v' (as you may have other tags to track commits other than releases). From the answers to this similar question: Git flow release branches and tags - with or without "v" prefix

like image 36
G. Stevens Avatar answered Oct 22 '22 10:10

G. Stevens