This document describes the workflow for contributing to the MapsAroundYou project using the fork model.
cs2103de-tp/MapsAroundYou # Organization (upstream/main)
↑
│ Pull Requests
│
<your-username>/MapsAroundYou # Personal fork (your GitHub account)
↑
│
Local Clone # Local development
- Go to: https://github.com/cs2103de-tp/MapsAroundYou
- Click the "Fork" button in the top-right corner
- Select your GitHub account as the destination
- Wait for the fork to be created
git clone https://github.com/<your-username>/MapsAroundYou.git
cd MapsAroundYougit remote add upstream https://github.com/cs2103de-tp/MapsAroundYou.gitgit remote -v
# Expected output:
# origin https://github.com/<your-username>/MapsAroundYou.git (fetch)
# origin https://github.com/<your-username>/MapsAroundYou.git (push)
# upstream https://github.com/cs2103de-tp/MapsAroundYou.git (fetch)
# upstream https://github.com/cs2103de-tp/MapsAroundYou.git (push)-
Sync your fork with upstream (recommended before starting new work):
git checkout main git fetch upstream git merge upstream/main git push origin main
-
Create a feature branch:
git checkout -b feature/your-feature-name
-
Make your changes and stage them:
git add . -
Commit with a descriptive message:
git commit -m "Description of your changes"Follow the commit conventions.
-
Push to your fork:
git push origin feature/your-feature-name
- Go to your fork on GitHub:
https://github.com/<your-username>/MapsAroundYou - Click "Compare & pull request"
- Select the base repository:
cs2103de-tp/MapsAroundYouand branch:main - Select the head repository:
<your-username>/MapsAroundYouand your feature branch - Fill in the PR title and description
- Click "Create pull request"
Once your PR is ready to merge (all conversations resolved and checks pass):
- If a reviewer has approved it, they may merge it, OR
- You can merge it yourself once the branch is up to date with main
Note: Reviewer approval is recommended but not enforced. The required
PR Quality Gatecheck must pass and all conversations must be resolved before merging.PR Quality GateaggregatesPR Quality CheckplusPR Build Gate (Linux),PR Build Gate (macOS), andPR Build Gate (Windows).
To keep your local fork in sync with the upstream organization:
# Fetch the latest from upstream
git fetch upstream
# Update your main branch
git checkout main
git merge upstream/main
# Push to your fork
git push origin main
# Update your feature branch if needed
git checkout feature/your-feature
git rebase main- Never push directly to the organization's main branch - it is protected
- Always create a PR for any changes you want to merge
- Wait for the required
PR Quality Gatecheck to pass before merging. It aggregatesPR Quality Checkplus the Linux, macOS, and Windows runnable-JAR build gates. - We recommend getting at least 1 approval before merging
- Keep your fork updated by regularly syncing with upstream
- Resolve all conversations in the PR before it can be merged
The organization's main branch has these protection rules:
- Required status check:
PR Quality Gatemust pass before merge PR Quality GateaggregatesPR Quality CheckplusPR Build Gate (Linux),PR Build Gate (macOS), andPR Build Gate (Windows)- Approving review: recommended (not enforced by branch protection)
- Protection applies to administrators (no bypass)
- Dismiss stale reviews when new commits are pushed
- Require conversation resolution before merging
| Action | Command |
|---|---|
| Clone fork | git clone https://github.com/<your-username>/MapsAroundYou.git |
| Add upstream | git remote add upstream https://github.com/cs2103de-tp/MapsAroundYou.git |
| Create branch | git checkout -b feature/name |
| Push to fork | git push origin feature/name |
| Sync with upstream | git fetch upstream && git merge upstream/main |