Title: Theory / Important / CS / Softw / VCS / Git / Revision / Single
Tags: hasNotNewEffectReturnsMeaning FromVariables computer_to_instruction fromCommandLine

Variable: @{upstream}
Meaning: The upstream branch of the current branch
Section: 5
Chapter: 3
Abbreviation: @{u}

Instruction: <refname>@{n}
Page: https://git-scm.com/book/en/v2/Git-Tools-Revision-Selection
Effect: The n-th previous value of <refname>
Context: git show
Chapter: 7
Section: 1
Assuming: refname has a an existing log

Instruction: branch@{yesterday}
Page: https://git-scm.com/book/en/v2/Git-Tools-Revision-Selection
Effect: Show the commit pointed by this branch yesterday
Context: git show
Chapter: 7
Section: 1

Instruction: <rev>^n
Page: https://git-scm.com/book/en/v2/Git-Tools-Revision-Selection
Effect: the n-th parent of <rev> which was merged into the current branch
Chapter: 7
Section: 1
Variables: foo represents a commit
Assuming: foo is a merge commit

Page: https://git-scm.com/docs/git-worktree
Syntactic sugar: -
Implementation: @{-1}

Typ: <sha1>
Meaning: The full SHA-1 object name (40-byte hexadecimal string), or a leading substring that is unique within the repository.
Page: https://git-scm.com/docs/git-worktree

Typ: <describeOutput>
Meaning: Output from git describe; i.e. a closest tag, optionally followed by a dash and a number of commits, followed by a dash, a g, and an abbreviated object name.
Page: https://git-scm.com/docs/git-worktree

Typ: <refname>
Meaning: A symbolic ref name.
Page: https://git-scm.com/docs/git-worktree

Question: In which direttories are refnames searched
Answer: $GIT_DIR/<refname>
Page: https://git-scm.com/docs/git-worktree
Answer2: refs/<refname>
Answer3: refs/tags/<refname>
Answer4: refs/heads/<refname>
Answer5: refsremoves/<refname>
Answer6: refs/remotes/<refname>/HEAD

Page: https://git-scm.com/docs/git-worktree
Syntactic sugar: @
Implementation: HEAD

Page: https://git-scm.com/docs/git-worktree
Syntactic sugar: @{n}
Implementation: same as currentBranch@{n}
Variables: n>0

Page: https://git-scm.com/docs/git-worktree
Syntactic sugar: @{-n}
Implementation: the <n>th branch/commit checked out before the current one.
Variables: n>0

Variable: <branchname>@{upstream}
Meaning: The upstream branch of <branchname>
Section: 5
Chapter: 3
Abbreviation: <branchname>@{u}

Variable: <branchname>@{push}
Meaning: The branch to which `git push` pushes from <branchname>
Section: 5
Chapter: 3

Variable: @{push}
Meaning: The branch to which `git push` pushes from currentBranch
Page: https://git-scm.com/docs/gitrevisions

Question: <rev>^0 equals
Answer: <rev>^{commit}
Page: https://git-scm.com/docs/gitrevisions

Page: https://git-scm.com/docs/gitrevisions
Syntactic sugar: <rev>^
Implementation: <rev>^1

Page: https://git-scm.com/docs/gitrevisions
Syntactic sugar: <rev>~
Implementation: <rev>~1

Instruction: <rev>^{commit}
Page: https://git-scm.com/docs/gitrevisions
Effect: Dereference <rev> until a commit is reached

Instruction: <rev>^{tree}
Page: https://git-scm.com/docs/gitrevisions
Effect: Dereference <rev> until a tree is reached

Instruction: <rev>^{tag}
Page: https://git-scm.com/docs/gitrevisions
Effect: dereference <rev> until a tag is reached

Instruction: <rev>^{object}
Page: https://git-scm.com/docs/gitrevisions
Effect: dereference <rev> until an existing object is reached

Instruction: <rev>^{}
Page: https://git-scm.com/docs/gitrevisions
Effect: dereference <rev> until a non-tag object is found

Instruction: <rev>^{/<text>}
Page: https://git-scm.com/docs/gitrevisions
Effect: The youngest commit reachable from <rev> whose commit messages matches /text

Page: https://git-scm.com/docs/gitrevisions
Syntactic sugar: :/<text>
Implementation: HEAD^{/<text>}

Instruction: <rev>:<path>
Page: https://git-scm.com/docs/gitrevisions
Effect: the blob or tree at <path> in the tree-ish object <rev>

Page: https://git-scm.com/docs/gitrevisions
Syntactic sugar: :<path>
Implementation: :0:<path>

Variable: :1:<path>
Meaning: object at path in the most common ancestor of all elements currently being merged
Page: https://git-scm.com/docs/gitrevisions
Assuming: currently in merge

Variable: :2:<path>
Meaning: object at path in the target branch version of the current merge
Page: https://git-scm.com/docs/gitrevisions
Extra: usually current branch
Assuming: currently in merge

Variable: :3:<path>
Meaning: object at path in the merged branch of the current merge
Page: https://git-scm.com/docs/gitrevisions
Assuming: currently in merge

Variable: :0:<path>
Meaning: object at path in the index
Page: https://git-scm.com/docs/gitrevisions