git branch show latest commit hash code example Example: git get current commit hash git rev-parse HEAD