如何“取消引用”一个字符串到 git sha1 哈希值?
如何获取 HEAD
、HEAD^^^
、HEAD~8
等引用的 sha1 哈希值?
我知道我可以破解 git show 来得到我想要的东西,但它会吐出一堆我不想要的其他东西。例如。
git show HEAD^^ --pretty=format:%H | head -n1
什么是更简单的命令,更直接地达到我想要实现的目的?
How do you get the sha1 hash for references like HEAD
, HEAD^^^
, HEAD~8
?
I know I can hack up git show
to get what I want, but it spits out a bunch of other stuff I don't want. Eg.
git show HEAD^^ --pretty=format:%H | head -n1
What is a simpler command that is more direct to the intent of what I am trying to achieve?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您想使用:
You want to use: