← ClaudeAtlas

git-operationslisted

Git command patterns, branching strategy, and safety protocols. TRIGGER when: managing branches, resolving merge conflicts, or running commit/merge/push operations. SKIP: worktree lifecycle and isolation recovery (use worktree-management); CI automation (use github-actions-template).
komluk/scaffolding · ★ 1 · Code & Development · score 74
Install: claude install-skill komluk/scaffolding
# Git Operations Skill ## Purpose Core git command patterns, branching strategies, and safety protocols for a project. ## Branching Convention | Branch Pattern | Purpose | |----------------|---------| | `main` | Production branch, always stable | | `scaffolding/{task_id[:12]}` | Worktree task branches (auto-created) | | `backup/{task_id[:12]}` | Safety backup before destructive ops | ## Safe Operation Patterns ### Before Any Destructive Operation ```bash git status git stash list git log --oneline -5 git branch backup/$(date +%s) HEAD ``` ### Merge Strategy ```bash git merge --no-commit --no-ff branch_name git diff --cached --stat git merge --continue # or --abort ``` ### Conflict Resolution ```bash git diff --name-only --diff-filter=U git checkout --ours path/to/file # keep ours git checkout --theirs path/to/file # keep theirs ``` ### Cherry-Pick ```bash git cherry-pick --no-commit <commit> git diff --cached --stat git cherry-pick --continue ``` ## Common Error Patterns | Error | Fix | |-------|-----| | `fatal: not a git repository` | Verify path, check .git exists | | `CONFLICT (content)` | Use conflict resolution protocol | | `cannot lock ref` | Wait and retry, check stale locks | | `worktree is not clean` | Stage+commit or stash | ## Push Operations ### Standard Push (after workflow) ```bash # 1. Verify unpushed commits exist git log --oneline origin/main..HEAD # 2. Push to remote git push origin main # 3. Verify push succeeded git log --oneline origin/