在某些项目中,该git describe --tags
命令会返回准确的最新标签名称,但在其他情况下,它会返回额外信息:
project1> git describe --tags
2.0-BETA6
project2> git describe --tags
1.5-13-g4abc82e
有没有办法调用 git describe 以便它仅返回第一种格式(仅 TAG)或仅返回第二种格式(带有提交信息的 TAG)。
我正在尝试更新一个 java 属性文件以包含一个具有最新标记的属性,以及另一个具有最新提交的属性。
万一这很重要,我正在使用“git version 1.7.9.6 (Apple Git-31.1)”