Skip to content

docs(advanced-git): push a branch deletion from a worktree, not from .bare - #480

Merged
CybotTM merged 1 commit into
mainfrom
docs/bare-branch-delete
Nov 22, 2026
Merged

CybotTM merged 1 commit into
mainfrom
docs/bare-branch-delete

Conversation

@CybotTM

@CybotTM CybotTM commented Nov 22, 2026

Copy link
Copy Markdown
Member

When this is merged, the Bare-Repo Layouts section of references/advanced-git.md tells agents to delete a remote branch from a worktree. Deleting it with git -C .bare push origin --delete <branch> fails in repositories with a pre-push hook.

Why

The push runs the pre-push hook with .bare as its directory. lefthook asks git for the work tree, gets fatal: this operation must be run in a work tree, and the push fails with error: failed to push some refs. The same push from <repo>/main succeeded in netresearch/ofelia on 2026-11-22.

….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>
@coderabbitai

coderabbitai Bot commented Nov 22, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

You'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.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: ad49d955-29e5-4a96-a1bd-1932952267ea
Commits

Reviewing files that changed from the base of the PR and between 1c35ad9 and dad3446.

Files selected for processing: 1

  • skills/git-workflow/references/advanced-git.md
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

Share

@sonarqubecloud

Copy link
Copy Markdown

@github-actions

Copy link
Copy Markdown
Contributor

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Scanned Files

None

@github-actions github-actions Bot added documentation Improvements or additions to documentation skill labels Nov 22, 2026
@CybotTM

CybotTM commented Nov 22, 2026

Copy link
Copy Markdown
Member Author

Author review of the diff: the new paragraph matches the error observed in netresearch/ofelia (pre-push hook run from .bare, fatal: this operation must be run in a work tree) and the push from main/ that succeeded there. It sits in the Bare-Repo Layouts section next to the other bare-layout traps. No findings.

@CybotTM
CybotTM marked this pull request as ready for review November 22, 2026 22:09
Copilot AI balanced review requested due to automatic review settings November 22, 2026 22:09

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@CybotTM

CybotTM commented Nov 22, 2026

Copy link
Copy Markdown
Member Author

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.

@CybotTM
CybotTM added this pull request to the merge queue Nov 22, 2026
Merged via the queue into main with commit 8279729 Nov 22, 2026
26 of 27 checks passed
@CybotTM
CybotTM deleted the docs/bare-branch-delete branch November 22, 2026 22:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation skill

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants