Skip to Content
ConventionsGit Workflow

Git Workflow

RNCopilot enforces a consistent git workflow with conventional commits, descriptive branch names, and automated pre-commit checks.

Commit Message Format

Every commit follows the conventional commit format:

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

Types

TypeWhen to Use
featA new feature
fixA bug fix
docsDocumentation changes only
styleFormatting, whitespace (no code logic change)
refactorCode restructuring without changing behavior
perfPerformance improvement
testAdding or updating tests
buildBuild system or dependency changes
ciCI/CD configuration changes
choreMaintenance tasks (upgrades, config tweaks)
revertReverting a previous commit

Scope

The scope describes the feature or area being changed. Common scopes:

auth, button, card, theme, i18n, api, storage, settings, navigation, deps

Examples

feat(auth): add forgot password screen fix(button): correct disabled state color in dark mode docs(conventions): add i18n section test(button): add accessibility tests refactor(api): extract error normalization to helper chore(deps): upgrade expo-router to 5.x perf(list): virtualize product listing scroll

Keep the subject line under 72 characters. Use the imperative mood (“add”, “fix”, “update”), not past tense (“added”, “fixed”).

Branch Naming

<type>/<short-description>
PatternExample
feat/<description>feat/product-listing
fix/<description>fix/rtl-badge-layout
chore/<description>chore/upgrade-expo-55

Use lowercase and hyphens. Keep descriptions short but descriptive.

Pre-Commit Checks

The project uses Husky to run npm run validate before every commit. This runs three checks:

  1. TypeScript type-checknpm run type-check
  2. ESLintnpm run lint
  3. Prettier format checknpm run format:check

All three must pass for the commit to succeed.

# Run manually before committing to catch issues early npm run validate

If the pre-commit hook fails, fix the reported issues and try again. Do not bypass the hook with --no-verify.

Workflow Summary

  1. Create a branch from main using the naming convention above.
  2. Make changes, keeping commits small and focused.
  3. Write commit messages in the conventional format.
  4. Run npm run validate before committing (or let Husky run it for you).
  5. Push and open a pull request against main.
Last updated on