Branching & Commits

  1. Create a New Branch for Each Issue

    • For every issue, create a dedicated branch.

    • Use a clear naming convention such as:
      2-setup-next-app, 14-add-authentication, etc.

  2. Do Not Commit Directly to main

    • All changes must go through a Pull Request.

    • Never push commits directly to the main branch.

  3. Commit for Each Related Change

    • Make commits that group together logically related changes.

    • Avoid committing large, unrelated changes in a single commit.

    • Each commit should represent one clear step or improvement.

  4. Follow Commit Message Conventions

    • Use clear, descriptive commit messages in the past tense, e.g.:

      • Implemented hero section

      • Refactored API response handler

      • Added user profile sidebar

  5. Use Squash & Merge

    • Before merging a PR, always squash commits.

    • Use the “Squash & merge” option from the GitHub merge dropdown.

    • This keeps history clean and ensures one meaningful commit per PR.