特定提交哈希的树哈希是什么? [英] What is the tree hash of a specific commit hash?

查看:89
本文介绍了特定提交哈希的树哈希是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要一个shell命令行,该命令行将树哈希与特定的提交哈希相对应.我知道git cat-file commit $COMMITID | grep ^tree可以做到,但是我必须过滤它的输出.有没有只打印哈希值的命令?

I need a shell command-line which puts the tree hash corresponding to a specific commit hash. I know that git cat-file commit $COMMITID | grep ^tree can do it, but I have to filter the output of that. Is there any command which prints only the hash?

推荐答案

git log -1 --pretty="%T" $COMMITID 

这篇关于特定提交哈希的树哈希是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆