Keeping track of your code, software, and progress with git and pixi
In Capstone Project 2, you fit a molecular clock to a tree of 24 SARS-CoV-2 genomes
I estimated that tree with a program called IQ-TREE, on my computer
Could you redo the whole analysis, from the genomes to the clock? Could I redo it a year from now?
A true story from October 2026:
What changed? Python 3.15 was released. The command asked for “the newest Python,” and one of marimo’s dependencies didn’t work with 3.15 yet
Software changes under your feet, even when your code doesn’t
In a survey of 1,576 researchers:1
Computational work should be the easy case: a computer does the same thing every time, if we give it the same data, code, software, and steps
| Ingredient | Example | How we’ll record it |
|---|---|---|
| Data | The 24 aligned genomes | Record how we got it (and a copy if it’s not huge) |
| Code | clock.py |
git |
| Software | Python 3.14, NumPy, IQ-TREE, … | pixi |
| Steps | The exact IQ-TREE command | pixi tasks |
| Randomness | IQ-TREE’s random search | A seed |
clock.py
clock_v2.py
clock_v2_fixed.py
clock_FINAL.py
clock_FINAL_omicron_removed_USE_THIS_ONE.py
A commit is a snapshot of your files, with a message, an author, and a date
$ git log --oneline
36c37de Leave Omicron out of the clock
2fc175a Add the molecular clock script and task
99de975 Estimate the ML tree with IQ-TREE
f9d8d06 Add task to download the SARS-CoV-2 alignment, and the data
3d7a7c5 Add IQ-TREE from bioconda
f2f0520 Create a pixi environment with Python 3.14
12f7a96 Add project title and author to README
539e886 Initial commit
One file name, and every version of it, forever
git addgit commitgit pushgit add) chooses which changes go in the next snapshotgit commit -m "message") saves the snapshotgit push) backs it up on GitHub, where others can see it| Command | What it does |
|---|---|
git status |
What has changed since my last commit? |
git diff <file> |
Exactly what changed, line by line |
git add <file> |
Stage a file’s changes for the next commit |
git commit -m "..." |
Save a snapshot of the staged changes |
git push |
Send my commits to GitHub |
git log --oneline |
List my commits |
git restore <file> |
Undo changes since my last commit |
| Commit it | Don’t commit it |
|---|---|
| Code and scripts | Installed software (.pixi/) |
The instructions for the software (pixi.toml, pixi.lock) |
Files that change every run (logs with dates) |
| Small data, and where it came from | Big data (record how to get it instead) |
| Key results (the tree, the figure) | Temporary files |
A .gitignore file lists what git should ignore
Our analysis needs Python, NumPy, SciPy, matplotlib, and IQ-TREE
Each of those needs other packages, which need other packages, …
Each one has a version, and a different version can change your results, or break your code
pixi.tomlpixi solvespixi.lockpixi install.pixi/pixi.toml and pixi.lock: small text files.pixi/: big, and pixi can rebuild it, exactly, from the lock fileTerminal
"python=3.14.*" pins the version we care aboutA task saves a command in pixi.toml, so anyone can rerun it
A codespace is a Linux computer in the cloud, which you use in your web browser, with git and pixi already installed
Codespaces are temporary: GitHub deletes a codespace after 30 days without use, even if your work isn’t pushed. Commit and push often!
At the end of the exercise, you will:
pixi run clockgit statusnothing to commit, working tree clean
The new computer reproduced your tree and figure, exactly
Each part ends with a push, so you can stop after any part
I drafted and iterated on these slides in collaboration with Anthropic’s Claude (Opus 5.5 model).