Git & GitHub Guide
This guide explains what Git is, how to use GitHub, and how to contribute to our team’s code and documentation.
What is Git?
Section titled “What is Git?”Git is a tool that tracks changes in files over time. It lets multiple people work on the same code without overwriting each other.
Think of Git like Google Docs “version history” but for robot code, CAD, and docs.
What is GitHub?
Section titled “What is GitHub?”GitHub is a website where we store our Git repositories (repos) online. It makes it easy for our team to share code, track issues, and collaborate.
Our team’s main GitHub organization is: 👉 https://github.com/BC-Robotics-4504 (BC Robotics)
Getting Started
Section titled “Getting Started”1. Install Git
Section titled “1. Install Git”- Windows: download Git for Windows
- Mac: use Homebrew →
brew install git - Linux: use your package manager (Ubuntu →
sudo apt install git)
Check it works:
git --version2. Set Your Identity
Section titled “2. Set Your Identity”Tell Git who you are (this shows up in commit history):
git config --global user.name "Your Name"git config --global user.email "you@example.com"3. Make a GitHub Account
Section titled “3. Make a GitHub Account”- Go to github.com
- Create an account with your school or personal email
- Ask a mentor to add you to Team 4504’s GitHub org
4. Clone the Repo
Section titled “4. Clone the Repo”Cloning means copying a repo from GitHub onto your computer.
Example for our robot code repo:
git clone https://github.com/Team4504/robot-code.gitcd robot-code5. Make a Branch
Section titled “5. Make a Branch”Branches are “copies” where you can safely make changes.
git checkout -b my-first-change6. Make Changes
Section titled “6. Make Changes”Open files in your editor (we recommend VS Code). Change code, docs, or CAD files.
7. Save Your Changes (Commit)
Section titled “7. Save Your Changes (Commit)”Stage and commit your edits:
git add .git commit -m "my first commit: fixed drivetrain constants"8. Push to GitHub
Section titled “8. Push to GitHub”Send your changes up to GitHub:
git push -u origin my-first-change9. Open a Pull Request (PR)
Section titled “9. Open a Pull Request (PR)”- Go to the repo on GitHub
- You’ll see “Compare & Pull Request”
- Describe what you changed
- Ask for a review → mentors or leads will merge it
Common Commands
Section titled “Common Commands”# check what files changedgit status
# see commit historygit log --oneline
# switch to another branchgit checkout main
# get the newest updates from GitHubgit pull origin mainVideo Tutorial
Section titled “Video Tutorial”This video from Fireship does a good job of explaining the basic git concepts: