Add repository scaffolding: .gitignore, README, CONTRIBUTING, MIT license, pre-push quality hook, and documentation covering branching, file conventions, and commit style. Establish the main/develop branching strategy. This is project setup only; no application functionality is included.
3.9 KiB
3.9 KiB
Branching Strategy
This document describes the branch model, naming conventions, and merge/rebase workflows for newzy.
Branches
Long-lived branches
| Branch | Purpose | Protected |
|---|---|---|
main |
Production-ready code. Always deployable. Receives releases. | Yes |
develop |
Integration branch. All features land here before release. | Yes |
Short-lived branches
| Branch | Created from | Merged into | Used for |
|---|---|---|---|
feature/* |
develop |
develop |
New features and enhancements |
bugfix/* |
develop |
develop |
Bug fixes not yet in production |
hotfix/* |
main |
main |
Critical fixes for production (immediate) |
Naming Conventions
- Use lowercase, kebab-case names:
feature/reader-view,bugfix/empty-feed-crash. - Prefix with the type:
feature/,bugfix/,hotfix/. - Keep the description short (2–4 words) and meaningful.
- Optionally prefix with an issue number:
feature/123-article-search.
Merge and Rebase Workflows
Feature development (rebase workflow)
Keep feature branches linear by rebasing onto the latest develop before pushing a pull request:
git checkout feature/reader-view
git fetch origin
git rebase origin/develop
# resolve any conflicts, then:
git rebase --continue
git push --force-with-lease origin feature/reader-view
Rule: only force-push branches that are still under active development and have not been merged. Never force-push
mainordevelop.
Merging into develop
- Feature and bugfix branches are squash-merged into
developso each feature appears as one clean commit. - The commit message of the squash commit must be a valid Conventional Commit (see commits.md).
Merging into main (releases)
developis merged intomainwith a merge commit (no squash, no rebase) to preserve the full feature history.- Example:
git merge --no-ff develop -m "release: cut v1.0.0". - Tag the resulting commit and push the tag.
Hotfixes
# 1. Branch off main
git checkout main
git pull --rebase origin main
git checkout -b hotfix/feed-outage
# 2. Fix, commit, and PR against main (merge commit)
# 3. After merging into main, back-merge into develop
git checkout develop
git pull --rebase origin develop
git merge --no-ff hotfix/feed-outage -m "merge: backport hotfix/feed-outage"
git push origin develop
Conflict Resolution Strategy
- Rebase early, rebase often. Resolve conflicts against
developat least once per day while a feature branch is active. - Resolve conflicts on the feature branch (the rebasing side), never by rewriting
main/develop. - After resolving, run
git rebase --continueand verify the app still works before pushing. - If a conflict cannot be resolved confidently, stop and ask for help in the pull request — do not guess.
- The person who created the conflict (usually the branch doing the rebasing) owns the resolution.
Do / Don't
| Do | Don't |
|---|---|
Branch off develop (or main for hotfixes) |
Commit directly to main or develop |
| Keep branches short-lived (ideally under a week) | Push broken/unfinished code to protected branches |
Use --force-with-lease when force-pushing |
Force-push shared or merged branches |
| Rebase before opening a PR | Merge develop back into your feature branch |