概述:我想在 Git 中设置自动(或至少半自动)软件版本编号。
我想为我的项目设置一些起始版本号(例如 v1.0)。我知道,出于这个原因,有 tag
。谷歌了一下,发现了一堆 Material 。例如:
You can create a new tag named 1.0.0 by executing
git tag 1.0.0 1b2e1d63ff
the1b2e1d63ff
stands for the first 10 characters of the commit id you want to reference with your tag.
Kudelabs说:
$ git tag -a 'milestone1' -m 'starting work for milestone 1, due in 2 weeks'
$ git push --tags
我真的很困惑。第一种方法和第二种方法有什么区别:git tag
和 git tag -a
。无法弄清楚使用哪个来达到此目的。
如何在裸远程存储库中设置版本号,我对其进行了 5-6 次提交和推送?
最佳答案
git describe
默认情况下使用带注释的标签。因此,为了遵循约定,请按照 Kudelabs 的说法创建带注释的 (-a
)。
关于git - 使用 GIT 进行软件版本编号,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12332060/