awk git the last commit hash


git log -n1|awk '/commit/ {print $2}'

Advertisements