Skip to content

Commit

Permalink
Merge branch 'ps/rewritten-is-per-worktree-doc'
Browse files Browse the repository at this point in the history
Doc update.

* ps/rewritten-is-per-worktree-doc:
  doc/git-worktree: mention "refs/rewritten" as per-worktree refs
  • Loading branch information
gitster committed Oct 20, 2023
2 parents 92741d8 + 8b3aa36 commit 4835409
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions Documentation/git-worktree.txt
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,8 @@ rules and how to access refs of one worktree from another.
In general, all pseudo refs are per-worktree and all refs starting with
`refs/` are shared. Pseudo refs are ones like `HEAD` which are directly
under `$GIT_DIR` instead of inside `$GIT_DIR/refs`. There are exceptions,
however: refs inside `refs/bisect` and `refs/worktree` are not shared.
however: refs inside `refs/bisect`, `refs/worktree` and `refs/rewritten` are
not shared.

Refs that are per-worktree can still be accessed from another worktree via
two special paths, `main-worktree` and `worktrees`. The former gives
Expand Down Expand Up @@ -363,8 +364,8 @@ linked worktree `git rev-parse --git-path HEAD` returns
`/path/other/test-next/.git/HEAD` or `/path/main/.git/HEAD`) while `git
rev-parse --git-path refs/heads/master` uses
`$GIT_COMMON_DIR` and returns `/path/main/.git/refs/heads/master`,
since refs are shared across all worktrees, except `refs/bisect` and
`refs/worktree`.
since refs are shared across all worktrees, except `refs/bisect`,
`refs/worktree` and `refs/rewritten`.

See linkgit:gitrepository-layout[5] for more information. The rule of
thumb is do not make any assumption about whether a path belongs to
Expand Down

0 comments on commit 4835409

Please sign in to comment.