Git Workflow
Intro
Use typed branch names, Conventional Commits, and PR descriptions
that explain the why. Squash-merge feature branches for a clean
history. Keep commits atomic and never force-push to shared
branches.
Overview
Branch naming
Format: <type>/<issue>-<short-description>
Types: feat/, fix/, refactor/, docs/, chore/
Examples:
feat/42-add-user-auth
fix/17-null-pointer-crash
refactor/89-extract-payment-service
Commit messages
Follow Conventional Commits:
- Format:
<type>: <description> — lowercase, imperative
mood, no trailing period
- Types:
feat, fix, refactor, docs, test, chore,
ci
- Body: explain WHY, not WHAT (the diff shows what)
- Footer:
fixes #N or refs #N for issue links
PR descriptions
- Title: same format as commit messages, under 70 characters
- Body: Summary (what and why), test plan, breaking changes
- Link related issues
Merge strategy
- Squash merge for feature branches — keeps mainline history
clean
- Merge commit for long-lived branches — preserves context
across the merge
- Rebase to keep a feature branch up to date before opening
the PR
Gotchas
Agent-specific failure modes — provider-neutral pause-and-self-check items:
- Mega-commits ("various fixes", 40 files changed). A commit that mixes unrelated changes is impossible to review, impossible to revert selectively, and tells a lie in its message. Each commit should represent one logical change that can stand alone.
- Force-pushing to shared branches. Force-pushing to
main or any branch others have checked out rewrites history they depend on, causing diverged local states that are painful to recover. Never force-push to a shared branch.
- Branches that live for months. Long-lived branches diverge from main, accumulate merge conflicts, and eventually require heroic merge efforts. Rebase weekly or split long-running work into shorter-lived feature branches.
- PRs with no description. "See commits" is not a description. The PR description is for the reviewer — it explains what changed, why it changed, and how to verify it. Write it before requesting review.
- Conventional Commit type misuse. Using
fix: for features or feat: for refactors corrupts any automation that generates changelogs or determines version bumps from commit types. Match the type to the nature of the change.
- Squash-merging a long-lived integration branch. Squash-merge is for feature branches with noisy "wip" commits. A long-lived branch with meaningful commit history should be merge-committed so the history is preserved for future investigation.
- Committing unrelated changes in the same PR to "save time". Reviewers are slower on unrelated changes combined in one PR; rollback becomes more expensive if one change needs reverting. Split unrelated changes into separate PRs.
Full reference
General rules
- Commit early and often on feature branches; squash at merge time.
- Never force-push to shared branches (
main, develop, release
branches).
- Keep commits atomic — one logical change per commit. A commit
that touches three unrelated concerns is three commits.
- A commit message body wraps at 72 columns; the subject line at
50 if you can.
Worked example
User: "What should I name this branch for adding search?"
Suggest feat/30-add-search-functionality if there's an issue
#30; otherwise feat/add-search-functionality. Match the
existing repo's convention if it differs.
Anti-patterns
- Mega-commits — "various fixes" with 40 files changed.
Impossible to review or revert.
- Force-push to main — destroys other contributors' work.
- Commit messages like "wip", "fix", "stuff" — every commit
should be reviewable on its own.
- PRs with no description — the PR description is for the
reviewer, not the author. "See commits" is not a description.
- Branches that live for months — long-lived branches
diverge from main and become merge nightmares. Rebase weekly
or split the work.
When to break the rules
Solo-on-a-private-branch force-pushes are fine. Trivial typo
fixes don't need a long body. Use judgment, but the defaults
above are right for almost every team setting.
1---2name: git-workflow3description: |4 Git workflow conventions — branch naming, conventional commits, PR descriptions, and merge strategy. Use when deciding on a branch name, writing a commit message or PR description, or choosing a merge strategy.5metadata:6 source: https://skillmd.com/skills/projectious-work/git-workflow7 processkit:8 apiVersion: processkit.projectious.work/v19 id: SKILL-git-workflow10 version: "1.1.0"11 created: 2026-04-06T00:00:00Z12 category: engineering13 layer: 314---1516# Git Workflow1718## Intro1920Use typed branch names, Conventional Commits, and PR descriptions21that explain the why. Squash-merge feature branches for a clean22history. Keep commits atomic and never force-push to shared23branches.2425## Overview2627### Branch naming2829Format: `<type>/<issue>-<short-description>`3031Types: `feat/`, `fix/`, `refactor/`, `docs/`, `chore/`3233Examples:3435- `feat/42-add-user-auth`36- `fix/17-null-pointer-crash`37- `refactor/89-extract-payment-service`3839### Commit messages4041Follow Conventional Commits:4243- **Format:** `<type>: <description>` — lowercase, imperative44 mood, no trailing period45- **Types:** `feat`, `fix`, `refactor`, `docs`, `test`, `chore`,46 `ci`47- **Body:** explain WHY, not WHAT (the diff shows what)48- **Footer:** `fixes #N` or `refs #N` for issue links4950### PR descriptions5152- **Title:** same format as commit messages, under 70 characters53- **Body:** Summary (what and why), test plan, breaking changes54- Link related issues5556### Merge strategy5758- **Squash merge** for feature branches — keeps mainline history59 clean60- **Merge commit** for long-lived branches — preserves context61 across the merge62- **Rebase** to keep a feature branch up to date before opening63 the PR6465## Gotchas6667Agent-specific failure modes — provider-neutral pause-and-self-check items:6869- **Mega-commits ("various fixes", 40 files changed).** A commit that mixes unrelated changes is impossible to review, impossible to revert selectively, and tells a lie in its message. Each commit should represent one logical change that can stand alone.70- **Force-pushing to shared branches.** Force-pushing to `main` or any branch others have checked out rewrites history they depend on, causing diverged local states that are painful to recover. Never force-push to a shared branch.71- **Branches that live for months.** Long-lived branches diverge from main, accumulate merge conflicts, and eventually require heroic merge efforts. Rebase weekly or split long-running work into shorter-lived feature branches.72- **PRs with no description.** "See commits" is not a description. The PR description is for the reviewer — it explains what changed, why it changed, and how to verify it. Write it before requesting review.73- **Conventional Commit type misuse.** Using `fix:` for features or `feat:` for refactors corrupts any automation that generates changelogs or determines version bumps from commit types. Match the type to the nature of the change.74- **Squash-merging a long-lived integration branch.** Squash-merge is for feature branches with noisy "wip" commits. A long-lived branch with meaningful commit history should be merge-committed so the history is preserved for future investigation.75- **Committing unrelated changes in the same PR to "save time".** Reviewers are slower on unrelated changes combined in one PR; rollback becomes more expensive if one change needs reverting. Split unrelated changes into separate PRs.7677## Full reference7879### General rules8081- Commit early and often on feature branches; squash at merge time.82- Never force-push to shared branches (`main`, `develop`, release83 branches).84- Keep commits atomic — one logical change per commit. A commit85 that touches three unrelated concerns is three commits.86- A commit message body wraps at 72 columns; the subject line at87 50 if you can.8889### Worked example9091User: "What should I name this branch for adding search?"9293Suggest `feat/30-add-search-functionality` if there's an issue94#30; otherwise `feat/add-search-functionality`. Match the95existing repo's convention if it differs.9697### Anti-patterns9899- **Mega-commits** — "various fixes" with 40 files changed.100 Impossible to review or revert.101- **Force-push to main** — destroys other contributors' work.102- **Commit messages like "wip", "fix", "stuff"** — every commit103 should be reviewable on its own.104- **PRs with no description** — the PR description is for the105 reviewer, not the author. "See commits" is not a description.106- **Branches that live for months** — long-lived branches107 diverge from main and become merge nightmares. Rebase weekly108 or split the work.109110### When to break the rules111112Solo-on-a-private-branch force-pushes are fine. Trivial typo113fixes don't need a long body. Use judgment, but the defaults114above are right for almost every team setting.