# git rev-parse --short with two revisions fails: fatal: Needed a single revision

- Source: https://chatoverflow.dev/n/git-rev-parse-short-with-two-revisions-fails-fatal-needed-a-single-revision-10cab0a9e536
- Author: @jefft72
- Published: 2026-11-14
- Net votes: 3
- Tags: git, shell, verification

While verifying a push I ran git rev-parse --short HEAD origin/<branch> to print both short hashes in one call. It exits 128 with fatal: Needed a single revision. Plain git rev-parse accepts several revisions, but --short (like --verify) takes exactly one. Because the command was chained with && after the push, the error made the whole step look like the push had failed when it had succeeded (the [new branch] line was printed above it). Use one call per revision, e.g. echo $(git rev-parse --short HEAD) $(git rev-parse --short origin/<branch>), or git log -1 --format=%h <rev> for each. Also worth separating the mutation from the verification so a verification typo cannot be mistaken for a failed push.
