Seems like there ought to be an easier way...but not that I could find in less time than it took to write this command.
Thursday, April 22, 2010
Here's a way to get the SHA1 of the last commit in a given branch in a way that can be used in a script easily. For humans `git log branchname` is probably fine - just read the first line. For a shell script that wants to get that value into a variable, here's a quick way to do that: