The many ways of selecting commits, sets of commits, and other references (e.g., branches) in git.
ref^{/text}- newest ancestor ofrefwith commit message matchingtext:/text- newest commit anywhere with commit message matchingtext:/!-text- negative match
ref@{date}, e.g.main@{yesterday}- the value ofrefat a given point in timeref@{n}, e.g.main@{2}- value ofref,nchanges ego.- that’s
HEAD{2},HEAD{3}, … seen ingit reflog
- that’s
@{n}, e.g.@{2}- current branch value 2 changes ago@{-n}, e.g.@{-2}-n-th branch/commit checked out before currentbranchname@{upstream}, short:branchname{u}- the upstream ofbranchname@{u}- the upstream of current branch. I often use it ingit reset '@{u}'orgit rebase '@{u}
ref^2- 2nd parent ofrefref~2=ref~~=ref^^- 2 commits beforerefref^{}- dereference a tag to find a non-tag (i.e., commit)
Revision ranges
git log lists the sum of commit sets, usually each being the set of commits reachable from the git log argumets. But there are other operators:
^ref- exclude commits reachable fromref. Therefore,git log ^origin/master HEADis the same asgit log origin/master..ref^@- all parents ofrefbut notrefitself
Sources
man gitrevisions