Git command to display HEAD commit id?
Use the command:
git rev-parse HEAD
For the short version:
git rev-parse --short HEAD
git log -1
for only commit id
git log | head -n 1
Old thread, still for future reference...:) even following works
git show-ref --head
by default HEAD is filtered out. Be careful about following though ; plural "heads" with a 's' at the end. The following command shows branches under "refs/heads"
git show-ref --heads