git get sha1 last commit on branch code example Example: git get current commit hash git rev-parse HEAD