Repository navigation
docs(advanced-git): push a branch deletion from a worktree, not from .bare - #480
Conversation
….bare In the bare-repo layout, git -C .bare push origin --delete <branch> runs the pre-push hook with .bare as its directory. lefthook asks git for the work tree there, gets "fatal: this operation must be run in a work tree" and the push fails. The Bare-Repo Layouts section now says to run the same push from any worktree of the repository, which worked in netresearch/ofelia on 2026-11-22. Signed-off-by: Sebastian Mendel <info@sebastianmendel.de>
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 54 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
|
Dependency Review✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.Scanned FilesNone |
|
Author review of the diff: the new paragraph matches the error observed in netresearch/ofelia (pre-push hook run from |
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing. Review the Copilot code review billing settings.
|
Self-review: dad3446 The bot review this pull request demands is unsatisfiable (Copilot quota wall or repeated bot failures on this head). The diff on this head was reviewed by the PR author; this comment is the on-the-record attestation the merge gate reads back. It stops matching on the next push. |



When this is merged, the Bare-Repo Layouts section of
references/advanced-git.mdtells agents to delete a remote branch from a worktree. Deleting it withgit -C .bare push origin --delete <branch>fails in repositories with a pre-push hook.Why
The push runs the pre-push hook with
.bareas its directory. lefthook asks git for the work tree, getsfatal: this operation must be run in a work tree, and the push fails witherror: failed to push some refs. The same push from<repo>/mainsucceeded in netresearch/ofelia on 2026-11-22.