Title: Theory / Important / CS / Softw / VCS / Git / Worktree

Variable: .git/config.worktree
Meaning: Working directory specific configuration file for the main working directory in multiple working directory setup
Page: https://git-scm.com/docs/gitrepository-layout
Context: git
Kind: file

Variable: .git/worktrees
Meaning: administrative data for linked working trees
Page: https://git-scm.com/docs/gitrepository-layout
Context: git
Kind: file
Assuming: GIT_COMMON_DIR is not set. Otherwise ignored

Variable: .git/worktrees/<id>/gitdir
Meaning: A text file containing the absolute path back to the .git file that points to here.
Page: https://git-scm.com/docs/gitrepository-layout
Context: git
Kind: file

Variable: .git/worktrees/<id>/locked
Meaning: If this file exists, the linked working tree may be on a portable device and not available. Ensure this worktree is not pruned even if temporarily unreachable
Page: https://git-scm.com/docs/gitrepository-layout
Context: git
Kind: file

Variable: .git/worktrees/<id>/config.worktree
Meaning: Working directory specific configuration file.
Page: https://git-scm.com/docs/gitrepository-layout
Context: git
Kind: file

Variable: extension.worktreeConfig
Meaning: Whether to read from config and also config.worktree
Page: https://git-scm.com/docs/gitrepository-layout
Context: git

Fla: --worktree
Effect: consider the value on worktree config
Page: https://git-scm.com/docs/git-config
Prefix: git config
Context: git

Question: Why are configs read from system up to worktree, while only the last read is taken intou account
Answer: any config read may change which is the next files to be read by changing the definition of local/worktree...
Page: https://git-scm.com/docs/git-config
Context: git

Fla: --single-worktree
Effect: limits the processing to reflogs from the current working tree only.
Page: https://git-scm.com/docs/git-fsck
Prefix: git reflog expire --all

Name: Per-worktree ref
Definition: Refs that are per-worktree, rather than global.
Page: https://git-scm.com/docs/gitglossary
Context: git
Definition2: Currently only HEAD and refs/bisect/

Name: A worktree
Definition: A working tree and repository metadata
Page: https://git-scm.com/docs/gitglossary
Context: git

name: post-checkout
command: checkout/switch/clone
after: having updated the worktree
when: without --no-checkout
args: refOfThePreviousHead refOfTheNewHead isBranchCheckout
expected: decide the command's exit status.
Repository validity checks, auto-display differences from the previous HEAD if different, or set working dir metadata properties.

Name: The main worktree
Definition: Worktree created by git init/clone, containing the .git repository

Name: A linked worktree
Definition: A worktree not containing a .git directory, and instead linked  to a main worktree

Fla: wortrkee add <path>
Effect: Create a new branch at path whose name is its final component
Page: https://git-scm.com/docs/git-worktree
Prefix: git

Fla: --detach
Effect: put new worktree in detached head mode
Page: https://git-scm.com/docs/git-worktree
Prefix: git wortrkee add <path>
Flag abbreviation: -d

Fla: prune
Effect: delete administrative files for worktree that were already deleted
Page: https://git-scm.com/docs/git-worktree
Prefix: git worktree

Fla: lock
Effect: ensure current worktree can't get automatically pruned
Page: https://git-scm.com/docs/git-worktree
Prefix: git worktree

Fla: --reason reason
Effect: State the worktree is locked due to reason
Page: https://git-scm.com/docs/git-worktree
Prefix: git worktree lock

Fla: <commit-ish>
Effect: initialize worktree at <path> with <commit-ish>
Page: https://git-scm.com/docs/git-worktree
Prefix: git worktree add <path>

Fla: list
Effect: list all worktree with their details
Page: https://git-scm.com/docs/git-worktree
Prefix: git worktree

Fla: move <fromPath> <toPath>
Effect: move worktree at from <fromPath> to <toPath>
Page: https://git-scm.com/docs/git-worktree
Prefix: git worktree

Fla: remove <path>
Effect: remove worktree at <path> if it is clean
Page: https://git-scm.com/docs/git-worktree
Prefix: git worktree

Fla: --force
Effect: remove worktree even if it's not clean
Page: https://git-scm.com/docs/git-worktree
Prefix: git worktree remove <path>
Flag abbreviation: -f

Fla: repair <path>...
Effect: Repair worktree administrative files, if possible, if they have become corrupted or outdated due to external factors.
Page: https://git-scm.com/docs/git-worktree
Prefix: git worktree

Fla: unlock
Effect: unlock the current worktree, allow it to be deleted by prune
Page: https://git-scm.com/docs/git-worktree
Prefix: git worktree

Fla: -b <new-branch>
Effect: Create a new branch <new-branch>. Fail if it already exists
Page: https://git-scm.com/docs/git-worktree
Prefix: git worktree add

Fla: -B <new-branch>
Effect: Create a new branch <new-branch>. reset if it already exists
Page: https://git-scm.com/docs/git-worktree
Prefix: git worktree add

Fla: --no-checkout
Effect: Don't checkout in the worktree added
Page: https://git-scm.com/docs/git-worktree
Prefix: git worktree add

Fla: --no-track
Effect: do not track
Page: https://git-scm.com/docs/git-worktree
Prefix: git worktree add

Fla: --lock
Effect: Keep the worktree locked after creation.
Page: https://git-scm.com/docs/git-worktree
Prefix: git worktree add

Fla: --dry-run
Effect: Do not remove anything, just report what it would remove
Page: https://git-scm.com/docs/git-worktree
Prefix: git worktree prune
Flag abbreviation: -n

Fla: --porcelain
Effect: utput in an easy-to-parse format for scripts
Page: https://git-scm.com/docs/git-worktree
Prefix: git worktree list

Fla: -z
Page: https://git-scm.com/docs/git-worktree
Prefix: git worktree list --porcelain
Print: Terminate each line with a NUL rather than a newline

Fla: --quiet
Effect: Suppress feedback messages.
Page: https://git-scm.com/docs/git-worktree
Prefix: git worktree add
Flag abbreviation: -q

Fla: --verbose
Effect: report all removals
Page: https://git-scm.com/docs/git-worktree
Prefix: git worktree prune
Flag abbreviation: -v

Fla: --verbose
Effect: output additional information about worktrees
Page: https://git-scm.com/docs/git-worktree
Prefix: git worktree prune
Flag abbreviation: -v

Fla: --expire <time>
Effect: only expire unused worktrees older than <time>.
Page: https://git-scm.com/docs/git-worktree
Prefix: git worktree prune

Fla: --expire <time>
Effect: annotate missing worktrees as prunable if they are older than <time>.
Page: https://git-scm.com/docs/git-worktree
Prefix: git worktree list

Variable: extensions.worktreeConfig
Meaning: Whether configuration changes are applied to worktree level or .git level
Page: https://git-scm.com/docs/git-worktree