且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

GIT 在特定提交之前获取提交哈希

更新时间:2022-11-15 21:02:02

使用 git show HEAD^1.您可以将 HEAD 替换为您的提交哈希

Use git show HEAD^1. You can replace HEAD with your commit-hash

如果您想查看提交哈希的所有父项,可以使用 git rev-list --parents -n 1 <commithash> 或使用 git show 正如@Bhaskar 在问题评论中所建议的那样.

In case you want to see all the parents for a commit hash, you can use git rev-list --parents -n 1 <commithash> or use git show as @Bhaskar suggested in the comments to the question.

还有其他方法以及解释这里.

There are other ways as well as explained here.