-
Notifications
You must be signed in to change notification settings - Fork 4
Git workflow and GitHub Setup
Laxman Singh Rawat edited this page Feb 26, 2026
·
1 revision
We follow a simplified Gitflow with main and develop as long-running branches.
| Branch | Purpose |
|---|---|
main |
Production-ready code only. Updated via releases. |
develop |
Integration branch where all features come together. Day-to-day working branch. |
- Create feature branches off
develop, e.g.feature/swipe-uiorfix/auth-bug - When done, open a Pull Request (PR) into
develop - At least one teammate reviews and approves before merging
- When the team agrees a set of features is ready for release,
developis merged intomainvia a PR - Delete feature branches after merging
- Pull from
developfrequently into your working branch:git pull origin develop - Keep feature branches short-lived — don't let them diverge for too long
- Agree on who owns which areas (e.g., one person on backend auth, another on frontend)
- Use
.editorconfigand formatters to avoid style conflicts:- React: Prettier
- Django: Black
repo-root/
├── backend/ # Django project
│ ├── manage.py
│ ├── requirements.txt
│ ├── app/
│ └── ...
├── frontend/ # React project
│ ├── package.json
│ ├── src/
│ └── ...
├── .github/ # To be updated with TravisCI
│ └── workflows/
│ ├── backend.yml # CI/CD pipeline for Django
│ └── frontend.yml # CI/CD pipeline for React
├── .editorconfig
├── .gitignore
└── README.md
Each workflow file uses path filters so pipelines only trigger when relevant code changes:
# Example: backend.yml
on:
push:
paths:
- 'backend/**'This keeps frontend and backend deployments independent, even within the same repo.
Apply these rules to both main and develop via Settings → Branches → Branch Protection Rules on GitHub.
| Policy | Reason |
|---|---|
| Require PR before merging | No one pushes directly to main or develop
|
| Require at least 1 approval | Ensures code is reviewed before integration |
| Require status checks to pass | CI tests must be green before merging |
| Require branch to be up to date | Forces pulling latest changes, reducing conflicts |
| Disallow force pushes | Protects commit history on long-running branches |