2013-01-08 36 views
3

如何从命令行上的sha1散列获取分支/功能名称?git命令显示来自sha1散列的分支/功能名称

此外,这是如何使用pretty = format语法完成的。

我看到,它的工作在某种程度上使用这种方法

git log --graph --full-history --all --color \ 
--pretty=format:"%x1b[31m%h%x09%x1b[32m%d%x1b[0m%x20%s" 

,但我不知道哪条线是导致此。

回答

2

如何从命令行中的sha1哈希获取分支/功能名称?

可以使用...

git branch --contains <sha1>