linux - git 命令显示来自 sha1 哈希的分支/功能名称

标签 linux git git-log

如何从命令行上的 sha1 散列中获取分支/功能名称?

还有这是如何使用 pretty=format 语法完成的。

我看到它是用这种方法以某种方式完成的

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

但我不知道是哪一行导致的。

最佳答案

How do I get the branch/feature name from a sha1 hash on the command line?

你可以使用...

git branch --contains <sha1>

关于linux - git 命令显示来自 sha1 哈希的分支/功能名称,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14206505/

相关文章:

python - 从 python 中查找 linux 系统二进制文件的路径

git - 将 Subversion 存储库转换为 git,为什么我会看到 "fatal: not a valid object name"?

git - 如何找出一行代码的变更历史

git Whatchanged - -M 做什么?

git - 我如何在 Git 中仅显示名称和自标签以来的提交标题?

linux - 向 Linux 桌面添加新的时间格式

linux - 从 git repo 中提取标签

linux - 是否可以配置 crontab 以在夏令时生效时调整其时间?

git - GitHub 上 pull request 中的分支名称

git - 如何查看 merge 到 merge 提交中的提交?