git - 在提交 git 中查找所有对象的 SHA1

标签 git

有没有办法检索 git 中特定提交内的所有对象(blob 和树)的所有 SHA1?

最佳答案

我很确定 git rev-list 会做你想做的事:

git rev-list --no-walk <commit> --objects

请参阅关于 git rev-list 的文档以获取更多信息 http://www.kernel.org/pub/software/scm/git/docs/git-rev-list.html .

编辑:根据 Paŭlo Ebermann 的建议添加了 --no-walk;这将只显示给定引用的对象,没有祖先提交。

关于git - 在提交 git 中查找所有对象的 SHA1,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6316352/

相关文章:

git 将新文件推送到裸仓库失败 : "error: src refspec master does not match any." Why?

python - 如何使用 bash 脚本重新启动在屏幕内运行的 python 脚本?

javascript - 将 sphinx 文档设为私有(private)

GitHub:当 master 改变时,我的 Fork 会更新吗?

Git: "Error: refusing to create funny ref ' HEAD' remotely"用于初始推送

git - 错误 此存储库已移动。请使用新位置

git - Jenkins 使用 Git 和 Deploy Key 构建

Git 排除分支中的提交

Git:如何从历史提交中删除文件?

git - 在 GitLab 中将多个 merge 请求链接在一起