# Git Workflow

> Use when committing and pushing code changes, ensures DCO compliance and pre-commit validation

- Skill: `zilliztech/git-workflow` (Agent Skill)
- Install (CLI): `npx skillmds@latest add zilliztech/git-workflow`
- Raw SKILL.md: https://api.skillmd.com/api/skills/zilliztech/git-workflow/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Productivity
- Author: zilliztech (https://skillmd.com/u/zilliztech)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/zilliztech/git-workflow

---


# Git Workflow

## Before Committing

Always run pre-commit validation:

```bash
# Validate specific files
pre-commit run --files <changed-files>

# Or validate all staged files
pre-commit run
```

Fix any issues before proceeding.

## DCO (Developer Certificate of Origin)

All commits must include a Signed-off-by line for DCO compliance:

```bash
git commit -s -m "commit message"
```

Or add manually:
```
Signed-off-by: Your Name <your.email@example.com>
```

## Commit Workflow

1. **Stage changes**
   ```bash
   git add <files>
   ```

2. **Run pre-commit**
   ```bash
   pre-commit run
   ```

3. **Fix any issues** and re-stage if needed

4. **Commit with DCO sign-off**
   ```bash
   git commit -s -m "type: description"
   ```

## Commit Message Format

```
type: short description

Optional longer description.

Signed-off-by: Name <email>
```

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

## Push

```bash
git push origin <branch>
```

## Quick Reference

| Task | Command |
|------|---------|
| Pre-commit check | `pre-commit run` |
| Commit with DCO | `git commit -s -m "message"` |
| Amend with DCO | `git commit --amend -s` |
| Push | `git push origin <branch>` |

