Branching Model
We follow a simplified Git Flow that prioritizes clarity and
reduces merge conflicts. All feature work happens in
isolated branches that merge back to development.
main
→
Production-ready code. Protected branch. Only tech
leads can merge.
dev
→
Integration branch. All features merge here first
for testing.
feature/*
→
Individual feature branches. Created from dev,
merged back to dev.
hotfix/*
→
Emergency fixes. Created from main, merged to both
main and dev.
Engineering Playbook, Section 4.2
Complete Workflow
Start by creating your project from the React template
on GitHub. Go to the template repository, select
“Use this template”, create your new
repository, then clone it to your machine.
git clone
git@github.com:Orctatech-Engineering-Team/YOUR-NEW-REPO.git
cd
YOUR-NEW-REPO
pnpm install
pnpm run dev
pnpm test
First Time Setup
Ensure you have Node.js 20+ and pnpm 10+ installed.
The template includes pre-configured ESLint,
Prettier, and TypeScript settings. Run the linter
with npm run lint
before committing.
Always create a new branch from the latest dev branch.
Never work directly on main or dev.
git checkout dev
git pull origin dev
git checkout -b
feature/user-authentication
Branch Naming Convention
Use descriptive kebab-case names:
feature/user-profile-page,
feature/payment-integration,
hotfix/login-redirect-bug
Build your feature following React best practices and
the template's folder structure.
src/ components/ user-profile/ user-profile.tsx
user-profile.test.tsx user-profile.module.css
-
Component names use PascalCase but their file names
are kebab-case:
user-profile.tsx
-
Component folders use kebab-case:
user-profile/
-
Test files match component names:
user-profile.test.tsx
-
CSS modules use kebab-case:
user-profile.module.css
Naming Conventions Guide, Section 2.4
Make atomic commits with clear, descriptive messages in
imperative mood.
git add
src/components/user-profile/
git commit -m
"Add user profile component with avatar
display"
Good Commits
Add user authentication form
Fix navigation menu overflow on mobile
Update API endpoint for user profiles
Refactor payment form validation logic
Bad Commits
Fixed stuff
Update
WIP
asdfasdf
Added feature and fixed bug and updated docs
Engineering Playbook, Section 4.1
Regularly sync your feature branch with dev to minimize
merge conflicts.
git fetch origin dev
git rebase origin/dev
git add .
git rebase --continue
Rebase vs Merge
We prefer rebasing feature branches to maintain a
linear history. This keeps the commit log clean and
makes it easier to understand the evolution of the
codebase. Only merge when integrating into dev or
main.
Ensure all tests pass and code meets quality standards
before pushing.
pnpm test
pnpm run lint
pnpm run lint:fix
pnpm run type-check
pnpm run build
Pre-commit Hooks
The template includes Husky pre-commit hooks that
automatically run linting and tests. If these checks
fail, the commit will be blocked. Fix the issues
before committing.
Push your feature branch to the remote repository.
git push -u origin
feature/user-authentication
git push
git push --force-with-lease
Force Pushing
Use
--force-with-lease
instead of
--force when you
need to force push after rebasing. This prevents
accidentally overwriting someone else's work if
they've pushed to your branch.
Open a pull request from your feature branch to dev. Use
the PR template.
gh pr create --base dev
--title
"Add user authentication"
-
Base branch should always be
dev (not main)
- Fill out all sections of the PR template
- Link to related issues or tickets
- Add screenshots for UI changes
- Request review from at least one team member
-
Add appropriate labels: feature, bug fix, refactor,
etc.
Engineering Playbook, Section 4.3
Respond to reviewer comments and make requested changes.
git add .
git commit -m
"Address review feedback: improve error
handling"
git push
Review Etiquette
Respond to all comments, even if just to
acknowledge. If you disagree with a suggestion,
explain your reasoning respectfully. Mark
conversations as resolved once addressed. Reviewers
should respond within 48 hours.
Engineering Playbook, Section 5.3
Once approved, merge your PR and delete the feature
branch.
git checkout dev
git pull origin dev
git branch -d
feature/user-authentication
git push origin --delete
feature/user-authentication
Merge Strategy
We use squash merging to keep the dev and main
branches clean. All commits from your feature branch
are combined into a single commit. Write a clear
merge commit message that summarizes the entire
feature.
Engineering Playbook, Section 4.3
Common Scenarios
Scenario: Working on Multiple Features
You're working on a user profile feature, but need to
start a hotfix for a critical bug.
git add .
git commit -m
"WIP: user profile layout"
git checkout main
git pull origin main
git checkout -b
hotfix/login-redirect
git checkout
feature/user-profile
Scenario: Merge Conflict During Rebase
You're rebasing your feature branch and encounter
conflicts.
git rebase origin/dev
git add .
git rebase --continue
git rebase --abort
Scenario: Accidentally Committed to Wrong Branch
You made commits to dev instead of a feature branch.
git checkout -b
feature/my-feature
git checkout dev
git reset --hard
origin/dev
git checkout
feature/my-feature
Scenario: Need to Update PR After Rebase
You rebased your feature branch and need to update the
PR.
git rebase origin/dev
git push --force-with-lease