Diagnose and bypass `gh pr merge --squash --delete-branch` failing with
"failed to run git: fatal: 'main' is already used by worktree at .…
Uma skill em “E-commerce e vendas”. Comandos prontos para Claude Code, Codex, OpenCode e mais 32 agentes.
Descrição completa
Diagnose and bypass `gh pr merge --squash --delete-branch` failing with
"failed to run git: fatal: 'main' is already used by worktree at ..." when
another git worktree has main checked out. Use when: (1) you run gh pr merge
and see this exact error, (2) you have multiple worktrees in the repo (e.g.
`.claude/worktrees/*`), (3) the error appears even though the GitHub merge
itself looks fine. The merge SUCCEEDED on GitHub — only gh's local-side
effect (post-merge `git checkout main`) failed. Verify via
`gh pr view N --json state,mergedAt`; if state=MERGED, you're done. This
also applies to `gh pr checkout` and any other `gh` subcommand that tries
to touch the local main branch while another worktree has it claimed.
v1.2.0 (2026-05-26) adds the sequential-error variant: if you re-run from
the main-repo worktree after the first error, you can then hit "cannot
delete branch <feature-branch> used by worktree at <feature-worktree>" —
same one-checkout-per-branch invariant, this time applied to the feature
branch. Cleanup order: `git worktree remove` BEFORE `git branch -D`.
v1.3.0 (2026-05-27) adds the `--auto --delete-branch` enable-time
variant: when checks are still pending, `gh pr merge N --auto --squash
--delete-branch` fails locally (same "main is already used by worktree"
message) BEFORE the auto-merge intent is registered server-side —
`gh pr view N --json autoMergeRequest` returns null. Workaround: drop
`--delete-branch` (`gh pr merge N --auto --squash`), then `git worktree
remove` + `git branch -D` manually after the merge lands. The post-merge
variant in v1.0-1.2 succeeds the merge first then chokes on cleanup;
this v1.3 variant chokes BEFORE the server-side enable, so verifying
with `--json autoMergeRequest` (not just `state`) is required.
Skill
E-commerce e vendas
35 agentes
5 estrelas
MIT
Este item vem do GitSkills conjunto de dados aberto (CC-BY-4.0). A ANG não executou nem auditou esta skill; confira a fonte antes de instalar.
AiderNenhum suporte a SKILL.md documentado para Aider.Fonte
PlandexNenhum suporte a SKILL.md documentado para Plandex.Fonte
CodeGPTNenhum suporte a SKILL.md documentado para CodeGPT.Fonte
SWE-agentNenhum suporte a SKILL.md documentado para SWE-agent.Fonte
mini-SWE-agentNenhum suporte a SKILL.md documentado para mini-SWE-agent.Fonte
JulesNenhum suporte a SKILL.md documentado para Jules.Fonte
Open SWENenhum suporte a SKILL.md documentado para Open SWE.Fonte
GitLab DuoNenhum suporte a SKILL.md documentado para GitLab Duo.Fonte
O suporte vem da documentação oficial de cada agente sobre SKILL.md e MCP; a ANG não executou este item em todos os agentes.
Em palavras simples
Sem precisar de formação técnica.
O que é?
Um skill é um pacote de instruções que você carrega no seu agente (como Claude Code ou Codex). É como instalar um app no celular: instala uma vez e o agente sabe fazer aquele trabalho.
Para que serve?
Usado em trabalhos de “E-commerce e vendas”. Nas palavras do publicador: Diagnose and bypass `gh pr merge --squash --delete-branch` failing with "failed to run git: fatal: 'main' is already used by worktree at ..." when another gi…
Exemplo de pedido
“Atualize as descrições dos produtos da loja.”
Agentes
Comandos prontos para Claude Code, Codex, OpenCode e mais 32 agentes.
Posso confiar?
5 estrelas no GitHub · MIT. Confira a fonte antes de instalar.
Uso
Últimos 30 dias, no site e nos agentes.
0em estantes
0visualizações
0comandos copiados
0downloads pelo site
0instalações pelo app
0instalações feitas pelo agente
0usuários ativos
Uma pontuação de uso real precisa de pelo menos 20 usuários e 50 tarefas no app da ANG; agora são 0 usuários e 0 tarefas. Até lá, a potência é estimada pelos dados da entrada.