Git Workflows
⚒️ Our Git Workflow
Section titled “⚒️ Our Git Workflow”🌳 Branch Structure
Section titled “🌳 Branch Structure”main— always deployable (production)dev— integration branch for ongoing workfeature/*— short-lived branches for new taskshotfix/*— urgent fixes frommain(for “oh shit” fixes only)
🦒 Workflow Steps
Section titled “🦒 Workflow Steps”1. Clone the Repo
Section titled “1. Clone the Repo”git clone <github-url>2. Create and Use the dev Branch (if dev branch already exists, skip to 3)
Section titled “2. Create and Use the dev Branch (if dev branch already exists, skip to 3)”git switch -b devgit push -u origin dev3. Start a New Feature
Section titled “3. Start a New Feature”git switch devgit pull origin devgit switch -b feature/your-task-name4. Make Changes and Commit
Section titled “4. Make Changes and Commit”git commit -m "Describe what you did"git push -u origin feature/your-task-name5. Create a Pull Request (PR)
Section titled “5. Create a Pull Request (PR)”- Merge into
devwhen reviewed and approved
6. Deploy to Production
Section titled “6. Deploy to Production”git switch maingit pull origin maingit merge devgit push origin main7. Optional: Tag the Release
Section titled “7. Optional: Tag the Release”git tag -a v1.0.0 -m "First release"git push origin --tags8. Hotfixes (Critical Fixes)
Section titled “8. Hotfixes (Critical Fixes)”git checkout maingit pull origin maingit checkout -b hotfix/issue-name
# After fix:git add .git commit -m "Fix critical issue"git push origin hotfix/issue-name
# PR to main, then merge into dev too📊 Visual Flow
Section titled “📊 Visual Flow” +------------------+ | main | | (production) | +--------+---------+ ^ | Merge to main when stable | +------v------+ | dev | | (staging) | +------+------+ ^ | +--------------+---------------+ | |+---v------------------+ +-------v------------------+| feature/your-feature | | hotfix/critical-issue || (off of dev) | | (off of main) |+----------------------+ +--------------------------+ | | PR to dev PR to main and dev