GIT get the commit hash prior to a specific commit

前端 未结 1 1721
不思量自难忘°
不思量自难忘° 2021-02-03 19:12

git 1.7.1

git show : gives me the file based on the commit hash provided

I am trying to figure out how to bet the file of th

相关标签:
1条回答
  • 2021-02-03 19:40

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

    Edit to take multiple parents into account:

    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.

    0 讨论(0)
提交回复
热议问题