/git-workflows:troubleshoot-worktreefrom git-workflows
Troubleshoot git worktree, branch, and refname issues
Ships in git-workflows. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Diagnose and fix worktree, branch, and reference issues.
Always run first:
git worktree list
git branch -a
git status
pwd
Never assume paths - always discover with git worktree list. The first
column is the path; the bracketed name is the branch checked out there.
Warning: warning: refname 'origin/main' is ambiguous
Means TWO things named origin/main:
refs/heads/origin/main - LOCAL branch (bad)refs/remotes/origin/main - remote tracking (good)Diagnose: git show-ref origin/main
Fix: git branch -D origin/main then verify only 1 line remains with git show-ref origin/main.
The same ambiguity can occur for any branch name, not just main — on a
git-flow repo (default branch develop) watch for origin/develop too.
Substitute the branch name in the diagnose/fix commands above.
git fetch origin --force
git branch -a | grep -i "<branch>"
git add . && git commit -m "WIP" # Commit
git stash push -m "before operation" # Stash (temporary)
git checkout -- . # Discard (DESTRUCTIVE)
git rm --cached <folder>
echo "<folder>/" >> .gitignore
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub jacobpevans-ai/claude-code-plugins --plugin git-workflows5 skills in this plugin
/git-workflow-standardsUse for branch hygiene, merge conflict resolution, and worktree cleanup./pre-commit-architectureUse when adding/editing .pre-commit-config.yaml, wiring pre-commit hooks into a repo, or scaffolding a new repo's lint/hook setup. Covers the canonical nix-devenv/dryvist-.github architecture, profiles, and consumer patterns./troubleshoot-precommitTroubleshoot pre-commit hook failures and auto-fixes