From skills
Use when choosing a branching strategy, hunting a regression with git bisect, running multi-worktree development, or configuring CODEOWNERS and merge queues — falsifiable conventions, not a git tutorial.
How this skill is triggered — by the user, by Claude, or both
Slash command
/skills:git-workflowThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Owner conventions plus the principal-level moves a strong model gets wrong by default. Generic git — stash, config, undo, conflict markers, semver tags — is assumed known and omitted.
Owner conventions plus the principal-level moves a strong model gets wrong by default. Generic git — stash, config, undo, conflict markers, semver tags — is assumed known and omitted.
Pick one per repo. The table is the decision; the note is the judgment.
| Strategy | Adopt when | Cost if misapplied |
|---|---|---|
| GitHub Flow | Short-lived feature/* off main, PR, merge, deploy | The right default; branches living past a few days rot into merge hell |
| Trunk-based | Strong CI and feature flags, merging several times/day | Without flags, half-built work ships to main on every push |
| Long-lived (GitFlow) | Scheduled releases or several supported versions in the field | Pure overhead for continuous-deploy SaaS — the develop branch just adds a hop |
main is always deployable and protected — no direct commits (owner hooks enforce this, below).<type>: <description>, type ∈ feat/fix/refactor/docs/test/chore/perf/ci. feat(auth): … is wrong here — write feat: ….test-gate, warn-destructive, block-main-commit). Prefer them; do not hand-roll .git/hooks scripts that duplicate or fight them.main to stay current. Never rebase a branch others have based work on — it rewrites their history out from under them. Update pushed branches with --force-with-lease, never --force.A test flipped red and you don't know which commit did it:
0 = good, 1 = bad, 125 = skip (commit won't build). Make it hermetic — pin deps inside the script. A non-hermetic build makes every bisect result a coin flip.git bisect start <bad> <good> then git bisect run ./check.sh. Git binary-searches and prints the first bad commit.--first-parent so bisect walks merges (the PRs), not every squashed-away intermediate commit.git log -S'symbol' (occurrence count changed) or -G'regex' (diff line matches) finds the introducing commit far cheaper than a full bisect.git fetch in one serves all; a stash pushed in one is visible in all.git worktree prune clears the dangling admin entry so its branch is deletable again.Solo throwaway repos and spikes skip worktrees, CODEOWNERS, and merge queues — commit to main and move on. The commit-message convention and "never rewrite shared history" still bind the moment a second person clones.
npx claudepluginhub bjornjee/skills --plugin skillsCreates, edits, and verifies skills using a test-driven development approach with pressure scenarios and subagents.