How to get parent of specific commit in Git?

前端 未结 8 1239
别跟我提以往
别跟我提以往 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条回答
  •  无人共我
    2021-02-02 06:34

    To get Parent Commit

    git cat-file -p commit_id
    
    tree tree_id
    parent parent_commit_id
    [parent other_parent_commit_id] # present only in case of merge commits
    author xxx  1513768542 +0530
    committer xxx  1513768542 +0530 
    

提交回复
热议问题