Single revision selection
During development, often, you’ll want to select a single revision in the history of the project so that you can examine it or compare it with the current version. The ability to select a revision is also the basis for selecting a revision range – for example, selecting a subsection of history to examine.
Many Git commands take revision parameters as arguments, which are typically denoted by <rev>
in the Git reference documentation. Git allows you to specify a commit or a range of commits in several ways. This will be described in this and the next section.
HEAD – the implicit revision
Most, but not all, Git commands that require the revision parameter default to using HEAD
. For example, git log
and git log HEAD
will show the same information. You can also use @
alone as a shortcut for HEAD
.
Here, HEAD
denotes the current branch, or in other words, the commit that was checked out into the working directory and forms a...