Title: Theory / Important / CS / Softw / VCS / Git / Stash
Tags: fromMath mathToDef

Name: The stash stack
Definition: The set of stack that were created, from most recent to oldest
Page: https://git-scm.com/book/en/v2/Git-Tools-Interactive-Staging
Chapter: 7
Section: 2
Context: git

Name: A stash
Definition: A set of changes done at some point in a working directory and saved for later
Page: https://git-scm.com/book/en/v2/Git-Tools-Interactive-Staging
Chapter: 7
Section: 2
Context: git

Fla: stash
stash push
Effect: Take all working directory and staging area changes and save them in the stash stack, put back working directory to HEAD state and empty staging area
Page: https://git-scm.com/book/en/v2/Git-Tools-Interactive-Staging
Prefix: git
Chapter: 7
Section: 2

Fla: stash list
Effect: display the stash stack content
Page: https://git-scm.com/book/en/v2/Git-Tools-Interactive-Staging
Prefix: git
Chapter: 7
Section: 2

Fla: apply@{n}
Effect: apply the n-th latest stash from the stash stack to working directory
Page: https://git-scm.com/book/en/v2/Git-Tools-Interactive-Staging
Prefix: git stash
Chapter: 7
Section: 2

Fla: --index
Effect: Add to staging area what was in staging area at time of stash creation
Page: https://git-scm.com/book/en/v2/Git-Tools-Interactive-Staging
Prefix: git stash apply
Chapter: 7
Section: 2

Fla: --kep-index
Effect: only add modified file to stash, not the staging area content
Page: https://git-scm.com/book/en/v2/Git-Tools-Interactive-Staging
Prefix: git stash
Chapter: 7
Section: 2

Fla: --include-untracked
Effect: Add all untracked files to stash too
Page: https://git-scm.com/book/en/v2/Git-Tools-Interactive-Staging
Prefix: git stash push|save
Flag abbreviation: -u
Chapter: 7
Section: 2

Fla: --all
Effect: add ignored files in the stash too
Page: https://git-scm.com/book/en/v2/Git-Tools-Interactive-Staging
Prefix: git stash push|save
Flag abbreviation: -a
Chapter: 7
Section: 2

Fla: --patch
Effect: Start a tool to interactively decide which part of changes should be stashed
Page: https://git-scm.com/book/en/v2/Git-Tools-Interactive-Staging
Prefix: git stash
Chapter: 7
Section: 2

Fla: --show-stash
Effect: Show the number of entries currently stashed away.
Page: https://git-scm.com/docs/git-add
Prefix: git status

Name: A stash entry
Definition: An object used to temporarily store the contents of a dirty working directory and the index for future reuse.
Page: https://git-scm.com/docs/gitglossary
Context: git

Variable: stash@{n}
Meaning: The n-th element of the stash list
Page: https://git-scm.com/docs/git-log
Context: git

Fla: show
Page: https://git-scm.com/docs/git-stash
Prefix: git stash
Print: Show the changes recorded in the stash entry as a diff between the stashed contents and the commit back when the stash entry was first created.

Fla: <diff-option>
Effect: Show diff options the same way as if `git diff <diff-option>`
Page: https://git-scm.com/docs/git-stash
Prefix: git stash show

Fla: <log-option>
Effect: Show stashed the same way as if `git log <log-option>`
Page: https://git-scm.com/docs/git-stash
Prefix: git stash list

Fla: pop <stash>
Effect: apply <stash> and drop it from the stack
Page: https://git-scm.com/book/en/v2/Git-Tools-Interactive-Staging
Prefix: git stash
Chapter: 7
Section: 2

Fla: apply <stash>
Effect: apply <stash> from the stash stack to working directory
Page: https://git-scm.com/book/en/v2/Git-Tools-Interactive-Staging
Prefix: git stash
Chapter: 7
Section: 2

Fla: branch<branchname> <stash>
Effect: Creates and checks out a new branch named <branchname> starting from the commit at which the <stash> was originally created, applies the changes recorded in <stash> to the new working tree and index.
Page: https://git-scm.com/book/en/v2/Git-Tools-Interactive-Staging
Prefix: git stash
Chapter: 7
Section: 2

Fla: drop <stash>
Effect: Remove <stash> from the list of stash entries
Page: https://git-scm.com/docs/git-stash
Prefix: git stash

Question: When stash is not explicit, which one is used
Answer: The top of the stack
Page: https://git-scm.com/docs/git-stash
Context: git stash

Question: How are stashes implemented
Answer: as regular commit object
Page: https://git-scm.com/docs/git-stash
Context: git stash

Fla: create
Page: https://git-scm.com/docs/git-stash
Prefix: git stash
Print: Create a stash entry (which is a regular commit object) and return its object name, without storing it anywhere in the ref namespace.
Extra: This is intended to be useful for scripts. It is probably not the command you want to use; see "push" above.

Fla: store <commit>
Effect: Store in the stash stack <commit>
Page: https://git-scm.com/docs/git-stash
Prefix: git stash
Extra: intended to be useful for scripts. It is probably not the command you want to use; see "push" above.

Fla: --no-include-untracked
Effect: Cancel a previous --include-untracked
Page: https://git-scm.com/docs/git-stash
Prefix: git stash

Fla: --only-untracked
Effect: Show only the untracked files in the stash entry as part of the diff.
Page: https://git-scm.com/docs/git-stash
Prefix: git stash show

Fla: --index
Effect: Tries to reinstate not only the working tree’s changes, but also the index’s ones.
Page: https://git-scm.com/docs/git-stash
Prefix: git stash pop|apply

Fla: --keep-index
Effect: All changes already added to the index are left intact.
Page: https://git-scm.com/docs/git-stash
Prefix: git stash pop|apply
Flag abbreviation: -k

Fla: --patch
Effect: Interactively select hunks from the diff between HEAD and the working tree to be stashed. The stash entry is constructed such that its index state is the same as the index state of your repository, and its worktree contains only the changes you selected interactively. The selected changes are then rolled back from your worktree.
Page: https://git-scm.com/docs/git-stash
Prefix: git stash push|save

Fla: --staged
Effect: Stash only the changes that are currently staged.
Page: https://git-scm.com/docs/git-stash
Prefix: git stash push|save
Flag abbreviation: -S

Fla: --pathspec-from-file=<file>
Effect: Pathspec is passed in <file> instead of commandline args.
Page: https://git-scm.com/docs/git-stash
Prefix: git stash push

Fla: --pathspec-file-nul
Effect: --pathspec-from-file are separated with nul symbols
Page: https://git-scm.com/docs/git-stash
Prefix: git stash push

Fla: --quiet
Effect: Suppress feedback messages.
Page: https://git-scm.com/docs/git-stash
Prefix: git stash apply|drop|pop|push|save|store
Flag abbreviation: -q

Fla: <pathspec>...​
Effect: Only stash working-tree and index of files matching <pathspec> are changed
Page: https://git-scm.com/docs/git-stash
Prefix: git stash push