2
可能重复:
How to retrieve the hash for the current commit in Git?我如何知道我在git中检出了哪个版本?
即什么是hg parent
或svn info
的git等价物。
一个答案,我可以在脚本中使用,即它给“bbh653ad”,而不是包含版本号字的负载某处
可能重复:
How to retrieve the hash for the current commit in Git?我如何知道我在git中检出了哪个版本?
即什么是hg parent
或svn info
的git等价物。
一个答案,我可以在脚本中使用,即它给“bbh653ad”,而不是包含版本号字的负载某处
要获得头的哈希值,使用此命令加分:
git rev-parse HEAD
或短表:
git rev-parse --short HEAD
如果你有标签,你正在寻找一个更具描述性的版本号,您可以考虑使用资源ult的命令:
git describe --long
长表格特别有用,因为它显示标签名称。 – ffghfgh 2017-01-24 14:58:08