Team FTC Git Workflow Guide
1. Cloning the Repository
-
Open a terminal (or the terminal inside Android Studio).
-
Navigate to the folder where you want to keep the project.
-
Run:
git clone https://github.com/KeshavAnandCode/DecodeFTCMain.git cd DecodeFTCMain -
Verify your remotes:
git remote -vYou should see:
origin https://github.com/KeshavAnandCode/DecodeFTCMain.git (fetch) origin https://github.com/KeshavAnandCode/DecodeFTCMain.git (push) upstream https://github.com/FIRST-Tech-Challenge/FtcRobotController.git (fetch) upstream https://github.com/FIRST-Tech-Challenge/FtcRobotController.git (push)
2. Keeping master Clean
-
mastershould only contain clean, tested code. -
Nobody should ever code directly on
master. -
To stay up to date:
git checkout master git fetch upstream git merge upstream/master git push origin master
3. Creating a Feature Branch
Whenever you start a new task (feature, fix, experiment):
-
Update
master(see above). -
Create a new branch from
master:git checkout master git pull origin master git checkout -b feature/short-description
Branch Naming Standard
Branches must follow the format:
<type>/<short-description>
Where <type> is one of:
feature/→ new functionalityfix/→ bug fixesexperiment/→ prototypes or testsdocs/→ documentation updateschore/→ maintenance or cleanup
Examples:
feature/autonomous-pathfix/motor-initexperiment/vision-testdocs/setup-instructionschore/gradle-update
Rules for names:
- Use lowercase letters and hyphens (
-) only. - Keep it short but clear (3–5 words).
- One branch = one task. Never mix unrelated work.
4. Working on Your Branch
-
Make changes in Android Studio.
-
Stage and commit your changes:
git add . git commit -m "short message about what changed" -
Push your branch to GitHub:
git push origin feature/short-description
5. Sharing Your Work
- Once your branch is ready:
- Open a Pull Request (PR) on GitHub to merge into
master. - At least one teammate should review before merging.
- Open a Pull Request (PR) on GitHub to merge into
6. Branching Rules
Do:
- Always branch from
master. - Follow the naming standard exactly.
- Keep branches small and focused.
- Delete branches after they’re merged.
Don’t:
- Don’t push commits directly to
master. - Don’t leave unfinished work on
master. - Don’t mix unrelated changes in one branch.
7. Example Workflow
# Get latest code
git checkout master
git fetch upstream
git merge upstream/master
git push origin master
# Start a new feature
git checkout -b feature/teleop-improvements
# Work on code, then commit
git add .
git commit -m "improved joystick scaling in TeleOp"
# Push branch
git push origin feature/teleop-improvements