我如何发现我藏匿的git commit哈希? [英] How can I discover the git commit hash that I stashed from?

查看:75
本文介绍了我如何发现我藏匿的git commit哈希?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我意识到我的问题与如何在"git存储列表"中列出存储的父提交获取git stash父提交,但是这些请求有很多令人困惑的,截然不同的答复,我在问自己的问题.

I realize that my question is very similar to How to list the parent commit of a stash in `git stash list` and Get git stash parent commit, but those had so many confusing, disparate responses that I'm asking my own question.

让我们假设如果我运行git stash list,我会看到stash@{0}: On featureX: someMessageHere

Let's assume that if I run git stash list, I see stash@{0}: On featureX: someMessageHere

如何隐藏存储时我正在处理的提交的哈希值(我认为这可以视为父提交)?

我看到了这么多不同的答案,但我对它们各自的作用,它们有何不同以及对我的问题的答案感到困惑,

I've seen so many different answers, and I'm confused about what these each do, how they are different, and which one is the answer to my question:

  • git show stash@{1}^
  • git log -1 commitish^
  • git log -1 stash@{0}^
  • git log -g --no-walk --parents refs/stash
  • git for-each-ref --format='%(refname:short)' --points-at $(git rev-parse refs/stash~1) refs/heads
  • git show stash@{1}^
  • git log -1 commitish^
  • git log -1 stash@{0}^
  • git log -g --no-walk --parents refs/stash
  • git for-each-ref --format='%(refname:short)' --points-at $(git rev-parse refs/stash~1) refs/heads
git log -g --format="%gd %H" refs/stash |
while read name hash; do
    printf "%s %s " $name $(git rev-parse --short $name^)
    git log -1 --format=%s $hash
done

有关其他内容,请推荐答案

您要查找的提交是stash@{0}^:

git show stash@{0}^
git log -1 --oneline stash@{0}^
git rev-parse stash@{0}^

这篇关于我如何发现我藏匿的git commit哈希?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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