get current commit message git

C++
git show
git log -1
git show <commit sha1> # Notice that the default option is HEAD.
Source

Also in C++: