Bare Repo Worktrees: Based on what branch is the new branch created? #767
Answered
by
asheshgoplani
Clindbergh
asked this question in
Q&A
-
|
When specifying the repo path as |
Beta Was this translation helpful? Give feedback.
Answered by
asheshgoplani
Apr 27, 2026
Replies: 1 comment
-
|
Good question, and worth a docs note. Behavior comes from
or: Whatever that prints is the base. To change it: Will add this to |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
Clindbergh
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Good question, and worth a docs note. Behavior comes from
internal/git/git.go::resolveWorktreeBranchplus the underlyinggit worktree addsemantics. For your bare-repo case:origin/feat/foo): tracked from the remote. Worktree starts at the remote tip.HEADin the bare repo. In a bare repo,HEADis whatever ref<repo>.bare/HEADpoints at. Usuallyrefs/heads/main(ormaster) since t…