Home / Offseason / Week O1
Offseason · Week 1 of 8

Git & GitHub

Branches, pull requests, commit messages, and the 2974 team workflow.

This comes before WPILib. A programmer who can't use Git can't safely contribute to the team codebase during build season. Learn this first, use it every session.

Core Concepts

Repository
The project + its history
Every commit ever made, every branch, every file. Lives on GitHub and on your laptop.
Commit
A saved snapshot
A point-in-time capture of your files with a message explaining what changed. The unit of work in Git.
Branch
A parallel line of work
Work on a feature in isolation without breaking main. When done, merge it back via a PR.
Pull Request
Request to merge + review
Open a PR when your branch is ready. Teammates review before it merges to main.

Daily Workflow

terminal
# 1. Start from current main
git checkout main
git pull

# 2. Create your feature branch
git checkout -b feature/shooter-pid

# 3. Make changes, then stage and commit
git add .
git commit -m "feat: add velocity PID to shooter flywheel"

# 4. Push and open a PR
git push origin feature/shooter-pid
# → go to GitHub and open a Pull Request

Never push directly to main. Always work on a branch and open a PR. Even if you're the only one working on it. This keeps the robot's working code safe from in-progress changes.

Branch Naming

PrefixUse forExample
feature/New functionalityfeature/auto-align
fix/Bug fixfix/shooter-pid-oscillation
refactor/Cleanup, no behavior changerefactor/drivetrain-cleanup
docs/Comments/docs onlydocs/intake-javadocs

Commit Messages

terminal — bad vs good
# BAD
git commit -m "stuff"
git commit -m "fixed it"
git commit -m "asdf"

# GOOD — type: short description of what changed
git commit -m "feat: add encoder-based speed control to shooter"
git commit -m "fix: prevent motor from running past limit switch"
git commit -m "refactor: extract PID constants to Constants.java"

Fill in the Blanks

# Create AND switch to new branch feature/elevator
git feature/elevator
# Stage all changed files
git
# Get the latest changes from remote main
git

Knowledge Check

Assignment — Your First PR

📝
First PR on the Team Repo
Real Git on real code

1. Clone sohnshaik/training-test-1
2. Create branch feature/yourname-intro
3. Add file intros/yourname.md with your name + one thing you want to build this season
4. Commit with a proper message
5. Push and open a Pull Request
6. Request review from Hrehaan or Sohan

When it merges, you've officially contributed to the team codebase.