Strictly speaking, we don't really need version control. We could store the code only a single person's laptop, or distribute copies of the code to everyone on the software team. However, as software members work on different aspects of the robot, managing the different copies of code gets very, very difficult. Just imagine how difficult it would be to manually combine someone's LED code, another person's Drivetrain edits, and some vendordep updates by hand. This is where version control comes in, specifically Git.
Git is the most popular version control system, and almost every major project uses it in some way or another. The core philosophy of version control is that changes in the codebase are like steps in a ladder. Our main code is stored in one big "trusted" ladder, where new changes will eventually be applied. When a software member chooses to develop a feature, they will diverge from the "trusted" ladder and make their changes, which will (hopefully) get merged back into the main ladder. This tree/ladder structure makes it extremely easy to see what changes were made and who made them. This means it is trivial to revert to a working version should the robot code stop working, and the branches allow multiple people to work on the same codebase without interfering with each other's changes.
Git provides the version control system and allows separation of code. However, we still have a problem: how can the code be distributed to all the software members and stored in a trusted place? This is the main function that services such as GitLab, GitHub, and Bitbucket provide. They provide a central machine (server) that all the software members will upload their code to. As well as providing this central server, they provide additional helpful features such as Issues, Merge Requests, and Pipelines.
These Git hosting platforms are, for the most part, interchangeable, but Valor chose GitLab because it was OSS and had the ability to be self hosted on our own servers (specifically Jan and Michael's).
In Git-land, there are many terms you need to know. Here are the most important:
gold-elevator-reset
and new-scorer-pit-sequence
221-update-pigeon-to-use-getyaw-and-update-status-signal-to-250hz
. If anybody wants to check out the branch and test it, it is a pain to type out.Submodules are a way to nest Git repositories inside of other Git repositories. One of the main ways that we use it is the relationship between robot code and Valkyrie, our software library. Because we want to use Valkyrie in multiple robot code repositories (primarily 2025 and 2026), we separated Valkyrie into its own repository and added it as a submodule into the 2026 robot code. The best part of the submodule setup is that we can tell Git to track a submodule by a specific commit ID or a branch. This means that during build season, we can tell Git that we want to track the main branch of Valkyrie so that it will automatically update Valkyrie when Valkyrie gets changes, but after the season is over, we can freeze the submodule at the latest commit that still works, and it will always stay the same while the Valkyrie repository gets changes.
Whew, most of the stuff above was theory, to get you to understand how Git and GitLab interact and how we use it. Now its time to actually get GitLab and Git set up on your computer. These instructions are for Windows, but they should be similar on Mac.
git
CLI command that you will use to create commits, switch branches, and push/pull branches.ssh-keygen -t ed25519
. Use the defaults they provide, and make sure that there is no passphrase. You should see a path matching something like C:\Users\<username>/.ssh/id_ed25519
.notepad C:\Users\<username>/.ssh/config
(should mostly match the path you saw above). It may ask you to create the file. If it does, answer yes.Host git.valor6800.com Port 6822 |
.ssh/config
file that says that when accessing the host git.valor6800.com
, it should use the port 6822
. cat ~/.ssh/id_ed25519.pub
. Copy the output. Go to the Valor GitLab, sign in, then click on your icon in the top right of the left sidebar, then go to Preferences → SSH Keys → Add new key. Paste the text you copied and set the expiration to four years from now (just sometime after you graduate). Click Add Key
.ssh -T git@git.valor6800.com
. If it succeeded, you should see something along the lines of Welcome to GitLab, ...!
git clone --recursive git@git.valor6800.com:valor6800/2026/robot.git
. The --recursive
flag tells Git to clone the submodules inside of the repository.This paragraph outlines the basic pathway for making changes to the repository.
git checkout main
. This checks out the main branch and stops you from diverging off a random branch.git pull
. Just fetch the latest changes.git checkout -b <branch name>
. This creates the branch and diverges off the main branchgit add .
. This stages all the files that you have changed. You don't need to know about staged changes for now, but just know that before running git commit
you should run git add
git commit -m "<commit message>"
. This creates a commit with the specified message. Recall good commit habits from above.git push -u origin <branch name>
. This pushes the branch to the remote server. The -u origin <branch name>
specified the remote branch name as it can be different from your local one. Once you push once, you no longer need to push the flag - you can just run git push
If you are working on your branch and changes were made to the main branch, you must run git rebase main
in your branch. The next time you push, you must git push --force
. This is because you essentially disrupted the commit history by injecting steps in the middle of the ladder instead of at the end with regular commits. Be very careful with git push --force
, however, as doing it on the wrong branch can lead to data loss!