Git. Rev-Parse. Getting latest commit

It helps you to find out the commit ID of the current HEAD (i.e. the current commit you are viewing)

git rev-parse HEAD
OR if you want the shorter commit

git rev-parse --short HEAD
If you want to find the latest commit in another branch, you can do

git rev-parse <local-branch-name>
git rev-parse origin/<remote-branch-name>

Source

This entry was posted in Без рубрики. Bookmark the permalink.