gpt4 book ai didi

git describe 只显示最新的标签和额外的提交

转载 作者:太空狗 更新时间:2023-10-29 13:32:15 25 4
gpt4 key购买 nike

git describe 有语法吗?只显示最新的标签和额外的提交?

让你得到

4.0.7 用于标记为 4.0.7
的提交4.0.7-12 自标记 4.0.7

以来有 12 次提交

git describe --tags4.0.7-12-g09181 非常接近,但我还没有找到摆脱附加哈希的方法。

git describe --tags --abbrev=2

仍然显示 4.0.7-12-g0918

git describe --tags --abbrev=0

仅显示 4.0.7

最佳答案

There is no option in the describe command to do what you want. You could pipe the output to a shell script that removes the hash.

git describe --tags | sed 's/\(.*\)-.*/\1/'

参见 https://stackoverflow.com/a/32084572/1468708

谢谢!

关于git describe 只显示最新的标签和额外的提交,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37316954/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com