← ClaudeAtlas

git-workflow-branchinglisted

When creating, updating, and merging code in a collaborative version control environment.
KraitDev/skiLL.Md · ★ 4 · AI & Automation · score 83
Install: claude install-skill KraitDev/skiLL.Md
# Git Workflow & Branching ## Purpose Clean git history is essential for debugging (`git bisect`), code review, and team collaboration. This skill standardizes branch naming, commit formatting, and merging to maintain a readable, revertible, and bisect-able history. ## When to use - Starting a new feature or bugfix ticket - Reviewing PRs and merging code into mainline - Hotfixing production environments - Onboarding new team members ## When NOT to use - Dealing with complex merge conflicts (use git documentation) - Repository history rewrites (different concern) - CI/CD trigger configuration (separate skill) ## Inputs required - Git repository with `main` branch - Remote repository (GitHub, GitLab, Gitea) - Team agreement on branch naming and commit conventions ## Workflow 1. **Sync Main**: ALWAYS fetch and pull latest from `main` before creating branch 2. **Create Branch**: Use convention `type/ticket-id-short-description` (e.g., `feat/PROJ-123-add-login`) 3. **Commit Atomically**: Commit in small logical chunks. MUST use Conventional Commits format 4. **Keep Branch Synced**: Rebase against `main` frequently to avoid merge conflicts 5. **Push Regularly**: Push to remote regularly (enables collaboration, backup) 6. **Rebase Before PR**: Interactive rebase to clean up WIP commits before opening PR 7. **Squash Merge**: Merge PR using squash-merge to keep main history clean 8. **Delete Branch**: Delete feature branch after merging (cleanup) ## Rules - MUST NEVER push direc