Git Internals and Plumbing/Verify commit revision

Ensure a revision resolves to a commit.

Section: Commit and History Plumbing

Verify commit revision

bash
bash
git rev-parse --verify HEAD^{commit}

Learn the surrounding workflow

Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.

Related commands

Same sheet · prioritizing Commit and History Plumbing
Create commit from tree
Create a commit object directly.
OpenIn sheetbashsame section
List commit IDs
Enumerate commits reachable from HEAD.
OpenIn sheetbashsame section
List commits and objects
Enumerate reachable objects.
OpenIn sheetbashsame section
Diff tree objects
Compare tree objects without porcelain diff.
OpenIn sheetbashsame section
Write blob object
Store file content as a blob and print its object ID.
OpenIn sheetbash1 tag match
List tracked files
Print index entries.
OpenIn sheetbash1 tag match