Retrieve the currently checked out commit in a git repository