--- name: managing-git description: Guides git workflows, branching strategies, commit conventions, and version control best practices. Use when managing repositories, creating branches, or handling merges. license: MIT compatibility: opencode metadata: category: workflow audience: developers --- # Managing Git Best practices for version control, branching strategies, and collaborative development. ## When to Use This Skill - Setting up branching strategies - Writing commit messages - Handling merges and conflicts - Managing releases - Code review workflows - Maintaining clean history --- ## Branching Strategies ### Git Flow ``` main ─────●─────────────────────●─────────────────●────▶ \ / / release \───────●─────────● / \ / develop ───────●───────●───────●──────●───────●────────▶ \ \ \ \ feature \───────●───────● \───●───● \ \ hotfix \ \───●────▶ main ``` | Branch | Purpose | Branches From | Merges Into | |--------|---------|---------------|-------------| | `main` | Production code | - | - | | `develop` | Integration | main | release | | `feature/*` | New features | develop | develop | | `release/*` | Release prep | develop | main, develop | | `hotfix/*` | Production fixes | main | main, develop | **Use when**: Scheduled releases, multiple versions supported ### GitHub Flow ``` main ─────●─────●─────●─────●─────●────▶ \ / \ / \ / feature ●─● ●─● ●─● PR PR PR ``` | Branch | Purpose | |--------|---------| | `main` | Always deployable | | `feature/*` | All changes (features, fixes) | **Use when**: Continuous deployment, simple workflow ### Trunk-Based Development ``` main ─────●──●──●──●──●──●──●──●──●──●────▶ │ │ │ │ │ │ │ │ │ │ ● ● ● ● ● ● ● ● ● ● Small, frequent commits (often direct to main) ``` **Use when**: High trust teams, strong CI/CD, frequent deploys --- ## Commit Message Conventions ### Conventional Commits ``` ():