← ClaudeAtlas

git-workflow-standardslisted

Use when managing branches, resolving merge conflicts, syncing with main, or working with worktrees
JacobPEvans/claude-code-plugins · ★ 3 · AI & Automation · score 69
Install: claude install-skill JacobPEvans/claude-code-plugins
# Git Workflow Standards ## Worktree Structure All development uses dedicated worktrees. Never work directly on main. ```text <repo>/ ├── .git/ # Shared bare repo ├── main/ # Main branch ├── feature/<branch-name>/ ├── bugfix/<branch-name>/ ├── hotfix/<branch-name>/ ├── release/<branch-name>/ └── chore/<branch-name>/ ``` Create: `git worktree add -b <branch> ../<branch> main` Remove: `git worktree remove ../<branch>` Every branch with commits MUST have an associated PR. Orphaned branches must get a PR or be deleted. **Stale worktree**: A branch with no open PR, no uncommitted changes, and either a merged PR whose `headRefOid` matches local `HEAD`, or a deleted remote (`[gone]`) with no commits ahead of the default branch (`git log origin/<default>..HEAD --oneline` is empty). Branches with open PRs, local-only branches without merged PRs, local commits beyond the merged PR head, and worktrees with uncommitted changes are NEVER stale. Use `git worktree remove` (never `--force`) — Git natively blocks removal of dirty worktrees. ## Branch Hygiene - Sync main daily: `git pull` - Long-running branches: rebase from main weekly - Before PRs: ensure branch is on latest main - Never branch from feature branches — always from main - Commit messages: conventional-commit prefixes only, no emoji (see `pr-standards`) | Method | When | | --- | --- | | `git merge origin/main` | Default — preserves history, safer | | `git rebase origin/main` | Only