Jason Meridth

I am a continuously learning senior full stack SDE/SRE trying to not let best be the enemy of better.

How to Get The SHA of The Last Commit on a Branch With Git

11 Mar 2014 » » git

I’ve been asked this a few times and have had to do it lately a few times.

To get the SHA of the last commit from a specific branch, use git rev-parse

git rev-parse origin/master (remote branch)

or

git rev-parse master (local branch)