The Go Blog

Go Generate

bantana
20 April 2018

设计逻辑

git get last commit ID

/* git log --pretty=format:'%Cred%h%Creset' -n 1 */
git log --pretty=format:%Cred%h%Creset -n 1
// 81e738e

or

git rev-parse HEAD
// 81e738e44ab0313f4c54ae67f8127541f4a06fad

Related articles