# Git Workflow

> Git operations, branching strategies, commit conventions, and repository management. Use when working with version control, creating branches, writing commits, or resolving merge conflicts. Use when this capability is needed.

- Skill: `tomevault-io/git-workflow-209` (Agent Skill, multi-file: 2 files)
- Install (CLI): `npx skillmds@latest add tomevault-io/git-workflow-209`
- Raw SKILL.md: https://api.skillmd.com/api/skills/tomevault-io/git-workflow-209/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: DevOps & Infra
- Author: tomevault-io (https://skillmd.com/u/tomevault-io)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/tomevault-io/git-workflow-209

---


# Git Workflow

## Commit Messages

```
<type>(<scope>): <subject>

[optional body]

[optional footer]
```

Types: `feat`, `fix`, `docs`, `style`, `refactor`, `test`, `chore`

Good: `feat(auth): add OAuth2 support for GitHub login`
Bad: `fixed stuff`

## Branch Naming

```
<type>/<ticket>-<description>
```

Examples:
- `feature/PROJ-123-user-authentication`
- `fix/PROJ-456-null-pointer-crash`
- `hotfix/PROJ-789-security-patch`

## Common Operations

```bash
# Interactive rebase to clean up commits
git rebase -i HEAD~3

# Squash last N commits
git reset --soft HEAD~N && git commit

# Cherry-pick specific commit
git cherry-pick <sha>

# Undo last commit (keep changes)
git reset --soft HEAD~1

# Find commit that introduced bug
git bisect start
git bisect bad HEAD
git bisect good <known-good-sha>
```

## Merge Conflict Resolution

1. `git status` — identify conflicted files
2. Open file, look for `<<<<<<<`, `=======`, `>>>>>>>`
3. Keep correct code, remove markers
4. `git add <file>` then `git rebase --continue` or `git merge --continue`

## Pre-commit Checks

Always run before pushing:
- Linting/formatting
- Unit tests
- Type checking (if applicable)

---
> Source: [aws-samples/sample-kiro-cli-multiagent-development](https://github.com/aws-samples/sample-kiro-cli-multiagent-development) — distributed by [TomeVault](https://tomevault.io).
<!-- tomevault:4.0:skill_md:2026-06-16 -->

