This guide explains how to set up and use our Git workflow to collaborate effectively and avoid merge conflicts during our project.
git checkout -b dev
git push origin dev- Go to GitHub → Settings → Branches
- Change default branch from
maintodev
Go to GitHub → Settings → Branches → Add rule
For both main and dev branches:
- ✅ Require a pull request before merging
- ✅ Require at least one approving review
there is a pull request folder on this repo that you can copy and use as your template
- Create
.github/pull_request_template.mdin your repo - Add your team's PR template content
- Push to
devbranch
| Branch | Purpose | Who uses it |
|---|---|---|
main |
Production code - don't touch! | Releases only |
dev |
Where everyone's work comes together | All team members |
feature/* |
Your individual work | You |
Examples: feature/login-page, feature/api-setup, fix/navbar-bug
-
Get the latest code
git checkout dev git pull origin dev
-
Create your feature branch
git checkout -b feature/your-task-name
-
Work and commit
# Do your coding work git add . git commit -m "Add: short description of your work" git push origin feature/your-task-name
Important: Always do this to avoid conflicts!
-
Get the latest changes
git checkout dev git pull origin dev
-
Update your branch
git checkout feature/your-task-name git merge dev
-
Fix any conflicts and test your code
-
Create a Pull Request on GitHub
- From: your
feature/your-task-namebranch - To:
devbranch
- From: your
-
Fill out the PR template
-
Request a review (use the Reviewers section)
-
Notify the team in Discord
- Use
@voyagerand include your PR link
- Use
Clean up and get ready for the next task:
git checkout dev
git pull origin dev
git branch -d feature/your-task-name # Delete the old branch
git checkout -b feature/your-next-task# Start new work
git checkout dev && git pull origin dev
git checkout -b feature/task-name
# Before creating PR
git checkout dev && git pull origin dev
git checkout feature/task-name && git merge dev
# After PR is merged
git checkout dev && git pull origin dev
git branch -d feature/old-task-name✅ Always work on feature branches, never directly on dev or main
✅ Always merge latest dev into your branch before creating a PR
✅ Keep PRs small and focused on one task
✅ Review teammates' PRs when requested
✅ Test your code before submitting
❌ Never push directly to main or dev
❌ Never merge your own PRs without review
This workflow keeps our collaboration smooth, our code clean, and our project on track!