Git flow release branches and tags - with or without “v” prefix

后端 未结 3 487
Happy的楠姐
Happy的楠姐 2021-01-29 23:13

I have seen multiple contradicting definitions on various git flow related websites. Is there an official recommendation or single source of truth?

Branches: relea

相关标签:
3条回答
  • 2021-01-29 23:40

    https://semver.org/#is-v123-a-semantic-version

    Is “v1.2.3” a semantic version? 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.3", in which case “v1.2.3” is a tag name and the semantic version is “1.2.3”.

    0 讨论(0)
  • 2021-01-29 23:41

    Well, basically it is a matter of preference, but I prefer the version with the v, as Semver does it that way and I try to follow that specification as close as possible to get a sane versioning.

    Edit note: Semver no longer specifies usage of the "v" prefix, but does not that it is "a common way to indicate a version number". In fact, Semver explicitly said that "v1.2.3" (for example) "is not a semantic version".

    It also makes filtering for those Tags easier, as you can press v and then the TAB-key for autocompletion: This will list all the tags (and maybe a few branches), whereas there are several digits a tag could start with.


    See also: Is there a standard naming convention for git tags?

    0 讨论(0)
  • 2021-01-29 23:47

    Since v stands for version, tags are generally named vX.Y.Z, with X.Y.Z following Semantic Versioning 2.0.0.

    This allows for branches X.Y.Z to co-exist with those tags, without having to deal with error message like "fatal: Ambiguous object name" (as in "Ambiguous Names with GIT?").

    Note that the tags for Git itself have recently been "adapted" for a surprising reason: see "Code version change “rules”".

    0 讨论(0)
提交回复
热议问题