简体   繁体   English

如何使用 GIT 进行语义版本控制?

[英]How does one do semantic versioning using GIT?

I have a mixed C/C++ source code and the version control is done using GIT.我有一个混合的 C/C++ 源代码,版本控制是使用 GIT 完成的。 We follow the Atlassian work flow ie create branch from master, work on the feature branch and when this work is deemed clean by the team, merge it to the master branch.我们遵循 Atlassian 的工作流程,即从 master 创建分支,在 feature 分支上工作,当团队认为这项工作干净时,将其合并到 master 分支。

My question is, everytime the software is merged to master, does git provide a way with which it automatically increments the software version.我的问题是,每次将软件合并到 master 时,git 是否提供了一种自动增加软件版本的方法。 Eg from v1.例如来自 v1。 0 to 1.1 and so on. 0 到 1.1 等等。

I am aware of commit hashes and git tags, but that's not what I'm looking for.我知道提交哈希和 git 标签,但这不是我要找的。 My goal is to output this detail in my software along with the commit that's on master.我的目标是在我的软件中输出这个细节以及在 master 上的提交。

Git does not do this on its own. Git 不会自行执行此操作。

You can easily add your own mechanism, and many have done so, but no two of them agree on how to do it .您可以轻松添加自己的机制, 许多人已经这样做了,但没有两个人就如何去做达成一致 See also Looking for a way automate the "bump version" with git flow .另请参阅寻找一种使用 git flow 自动化“凹凸版本”的方法

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM