在Git中查找提交ID的提交日志

Shr*_*dha 58 git

我想查看ID提交.例如,我想知道为该ID提交的代码,例如:

git log <commit_id>
Run Code Online (Sandbox Code Playgroud)

这将显示与此ID对应的已提交代码和提交消息.

Set*_*son 111

git show <commit_id>
Run Code Online (Sandbox Code Playgroud)

可能是你正在寻找的机器人.

  • @Vojta:请参阅/sf/ask/189475821/,也称为:`git branch --contains <commit>` (2认同)

Noi*_*art 6

@SethRobertson的解决方案对我有用,但显示出差异。我想看到它就像git log显示它一样。因此添加--no-patch

git show <commit_id> --no-patch
Run Code Online (Sandbox Code Playgroud)

我从-/sf/answers/2201407911/了解到这一点