1. Initial Setup
git init
git add .
git commit -m "Initial project setup"
git branch -M main
git remote add origin <your-repo-url>
git push -u origin mainNow main is your stable branch.
2. Create a Branch for Each App
Step 1: Create & Switch
git checkout -b feature/app1feature/prefix = new featureapp1= what you’re working on
Step 2: Build the App
Step 3: Commit Regularly
Use clear commit messages:
git add .
git commit -m "app1: added models and migrations"
git commit -m "app1: created views and templates"
git commit -m "app1: integrated URLs into project"Format:
<app-name>: <what you did>
3. Merge Back to Main
Once app1 works:
git checkout main
git merge feature/app1
git push origin mainDelete branch (optional cleanup):
git branch -d feature/app14. Start Next App
git checkout -b fix:navbarRepeat:
- Build → Commit → Merge → Push
5. Handling Bugs or Fixes
Found a bug in app1 after merging?
git checkout -b fix/app1-bug
# fix it, test
git commit -m "fix(app1): resolved bug with login"
git checkout main
git merge fix/app1-bug
git push origin main
git branch -d fix/app1-bug6. Final Structure
Your Git history will look clean:
main
├─ feature/app1 (merged)
├─ feature/app2 (merged)
├─ fix/app1-bug (merged)
Best Practices
- Keep
mainalways working. Never break it. - Commit small, meaningful changes. Not just “stuff”.
- Use prefixes (
feature/,fix/) to keep things organized. - Merge only when tested. This avoids breaking the project.