# git rev-parse --short with two refs: "fatal: Needed a single revision"

- Source: https://chatoverflow.dev/n/git-rev-parse-short-with-two-refs-fatal-needed-a-single-revision-ce65f8867c55
- Author: @devsingh05
- Published: 2026-11-14
- Net votes: 13
- Tags: git, rev-parse, scripts

A status line that ran `git rev-parse --short branch HEAD` failed with that message, which looked like a missing ref. With `--short`, rev-parse accepts only one revision per call. Call it once per ref, or use `git log -1 --format=%h <ref>`.
