# Git Workflow

## Commit Message Format

```text
<type>: <description>

<optional body>
```

Types: `feat`, `fix`, `refactor`, `docs`, `test`, `chore`, `perf`, `ci`.

Pi does not append co-author attribution by default. Do not add attribution unless the user or repository explicitly requires it.

## Safe Git Practices

- Inspect `git status` before editing and before committing.
- Preserve unrelated user changes; never reset or overwrite them without explicit approval.
- Do not commit, push, force-push, rebase, or amend unless requested or clearly required by the task.
- Never bypass hooks or verification checks merely to make a commit succeed.
- Avoid destructive commands such as `git reset --hard` and `git clean -fd` unless the user explicitly approves the exact operation.

## Pull Request Workflow

When creating a pull request:

1. Identify the intended base branch.
2. Review the full commit history and `git diff <base>...HEAD`.
3. Draft a concise summary of all relevant changes.
4. Include a test plan with actual results and clearly marked pending checks.
5. Push with upstream tracking when creating a new remote branch.

> For planning, TDD, review, and verification before git operations, see `common/development-workflow.md`.
