GIT get the commit hash prior to a specific commit

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.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)