How to get last commit id in git

In this article let’s discuss about How to get last commit id in git . Let’s go through the following methods without any delay.

Method 1:

$ git reset --soft HEAD~1

If you are facing any issues with the above approach then try the alternative that is given below. It may look similar by have a try!

Method 2 :

git log --format="%H" -n 1

Hope the above solution works.

Realted Posts : How to update pip in linux