How can I check with the command line the latest commit hash of a particular Git branch?
Note that when using "git log -n 1 [branch_name]" option. -n returns only one line of log but order in which this is returned is not guaranteed. Following is extract from git-log man page
.....
.....
Commit Limiting
Besides specifying a range of commits that should be listed using the special notations explained in the description, additional commit limiting may be applied.
Using more options generally further limits the output (e.g. --since= limits to commits newer than , and using it with --grep= further limits to commits whose log message has a line that matches ), unless otherwise noted.
Note that these are applied before commit ordering and formatting options, such as --reverse.
-
-n
.....
.....