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