Skip to content
learnFRC.org
programminglesson30 min

Git for Robotics Teams

Version control conventions, repository structure, team .gitignore rules, and Gradle wrapper builds for FRC teams.

What you will learn

  • Understand the file structure of an FRC WPILib Gradle project.
  • Configure `.gitignore` rules to keep temporary build artifacts out of version control.
  • Follow feature-branch Git workflows and verify builds locally using `./gradlew build`.

Prerequisites:Tooling Installation

Robotics software is written by multiple students and mentors under intense competition deadlines. Without version control, code gets accidentally overwritten, untracked changes cause erratic field behavior, and reverting breaking changes becomes impossible.

This lesson establishes standard Git practices for FRC software development.


A standard WPILib Java repository is organized into specific directories managed by the Gradle build system:

robot-project/
├── .gitignore # Files excluded from version control
├── build.gradle # Gradle dependencies and WPILib plugins
├── gradlew, gradlew.bat # Gradle wrapper scripts for Unix and Windows
├── vendordeps/ # JSON manifests for CTRE, REV, PathPlanner
└── src/
└── main/
├── deploy/ # Non-code assets pushed to roboRIO (paths, configs)
└── java/
└── frc/
└── robot/
├── Main.java # Program entry point (do not edit)
├── Robot.java # Low-level loop cycles
├── RobotContainer.java # Subsystems and controller bindings
├── Constants.java # CAN IDs, gear ratios, PID gains
├── commands/ # Command classes and autonomous logic
└── subsystems/ # Hardware subsystem wrappers

Robotics projects generate large build artifacts and multi-megabyte telemetry logs. Committing binary build files bloats repository history and causes merge conflicts between team members.

Verify that your .gitignore includes the following patterns:

# Gradle build outputs
build/
.gradle/
bin/
# IDE files
.idea/
*.iml
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/extensions.json
# AdvantageScope and WPILib data logs
*.wpilog
*.dlog
# OS metadata
.DS_Store
Thumbs.db
Never Commit .wpilog Files

AdvantageScope and WPILib DataLog generate .wpilog binary files that can easily exceed 50 MB per match. Committing these files quickly exceeds GitHub repository limits and slows down git clone operations for all team members.


Follow a trunk-based or feature-branch model:

  1. Keep main deployable: Code on the main branch must always compile and run safely on the physical robot without crashing.
  2. Create short-lived feature branches: Before writing a new mechanism subsystem or autonomous routine, branch off main:
    Terminal window
    git checkout main
    git pull origin main
    git checkout -b feat/intake-subsystem
  3. Commit with intention: Make small, frequent commits with clear messages:
    Terminal window
    git commit -m "Configure intake Talon FX stator current limit to 40A"
  4. Open a Pull Request: Submit a PR to main and have a peer student or mentor review your changes before deploying to the physical robot.

  • Symptom: Git blocks a merge due to conflicts in a vendor JSON file.
  • Cause: Two team members installed or upgraded vendor libraries on different branches.
  • Fix: Re-run WPILib: Manage Vendor Libraries from the Command Palette on main to regenerate a clean JSON, or accept the latest version block manually.
  • Symptom: git status lists hundreds of .class files in build/.
  • Cause: Project was initialized before creating .gitignore.
  • Fix: Run git rm -r --cached build/ and commit the updated .gitignore.

  1. Clone your team repository to your workstation:
    Terminal window
    git clone <repository-url>
    cd <repository-directory>
  2. Build the project using the Gradle wrapper:
    • On Windows: .\gradlew.bat build
    • On macOS/Linux: ./gradlew build
  3. Verify that git status reports a clean working tree:
    On branch main
    nothing to commit, working tree clean

Verified Sources & Standards

Evergreen Standard Verified: Sep 25, 2026