How to get parent of specific commit in Git?

前端 未结 8 1243
别跟我提以往
别跟我提以往 2021-02-02 06:25

I have commit number. I would like to get previous commit number(parent). I need commits from current branch.

8条回答
  •  猫巷女王i
    2021-02-02 06:33

    For the full details: git log 4c7036e807fa18a3e21a5182983c7c0f05c5936e^ -1

    For just the hash: git log 4c7036e807fa18a3e21a5182983c7c0f05c5936e^ -1 --pretty=%H

提交回复
热议问题