revision
Any expression Git accepts as a name for a commit or other object, such as an ID, a branch name, a tag, HEAD or HEAD~2.
In more detail
Where Git's documentation writes REV or rev you can type any of these. A colon and a path after one, as in HEAD:notes.txt, names a file in that commit's tree, and a colon with nothing before it, as in :notes.txt, names the staged version.
Example
git cat-file -p HEAD:notes.txtRelated terms
- ancestry reference — A way of naming a commit by counting back from another: a tilde and a number walk back that many first parents, and a caret picks which parent.
- object ID — The hash that names a Git object, such as a commit, and that you type to refer to it.
- commit range — Two revisions joined by dots to name a set of commits, or with git diff to choose which two states to compare.
- git show — The command that displays one object in full, usually a commit with its message and patch, or a file as it was in a given commit.
Taught in
- A Repository Is A Folder With A Memory — Advanced Git Internals & Distributed Workflows
- Reading History: log, show And diff — Advanced Git Internals & Distributed Workflows
- Investigating History: blame, bisect And worktree — Advanced Git Internals & Distributed Workflows