A structured Git workflow prevents code overwrites, speeds up rollbacks when software faults occur, and keeps parallel development organized.
Branching Strategy: Short-Lived Feature Branches
Section titled “Branching Strategy: Short-Lived Feature Branches”We recommend a Trunk-Based / Short-Lived Feature Branch workflow:
mainBranch: Contains code that is tested and known to run safely on the physical robot. Deploying frommainshould never cause an unhandled exception or mechanical crash.- Feature Branches: Created for specific tasks:
feat/intake-indexer-logictune/shooter-velocity-gainsauto/4-piece-center-subwoofer
- Pull Requests (PRs): Require review by at least one other student or mentor before merging into
main.
Competition Tagging
Section titled “Competition Tagging”Before your first qualification match, tag the exact commit currently deployed to the roboRIO:
git checkout maingit tag -a comp-event-match-01 -m "Code on robot for Qualification Match 1"git push origin --tagsWhy Tag Matches?
If the robot behaves erratically in Match 4, comparing git diffs between comp-event-match-01 and the current commit immediately reveals which constant or logic change caused the issue.
Repository Exclusions (.gitignore)
Section titled “Repository Exclusions (.gitignore)”Never commit build artifacts, cache files, or machine-specific binaries:
# Gradle & WPILib build artifactsbuild/.gradle/bin/
# IDE files.idea/*.iml.vscode/*!.vscode/settings.json!.vscode/extensions.json
# AdvantageScope & DataLog logs*.wpilog*.dlogVerified Sources & Standards
- WPILib Source Code Management with Gitdocs.wpilib.orgWPILib Standard