Building Module 7 · Git: Your Safety Net

Why Version Control?

What you'll learn

~15 min
  • Explain why version control matters when working with AI tools
  • Describe how git commits work using the Google Docs analogy
  • Distinguish between git (the tool) and GitHub (the service)
  • Install git and complete one-time setup

By the end of this lesson, you’ll understand why version control is the single most important safety habit to build before you start directing AI tools — and you’ll have git installed and configured on your machine.

The Mental Model: Lab Notebooks and Track Changes

If you’ve ever kept a lab notebook, you already understand version control. Every entry is dated. You never erase old entries — you draw a line through mistakes and write corrections. If an experiment goes wrong, you can flip back to last week’s protocol and see exactly what was different.

Git is a digital lab notebook for your entire project folder. Every “entry” (called a commit) records what changed, when, and why. You can flip back to any previous entry at any time.

The Problem

You’ve been working on a project. It’s going great. Then you make a change and everything breaks. You press Ctrl+Z a few times, but it’s not undoing what you need. You try more changes to fix it. Now things are even worse, and you can’t remember what the working version looked like.

Sound familiar? This happens to everyone — beginners and experts alike.

Now multiply that problem by ten. When you direct an AI CLI tool like Claude Code, it might edit 15 files in a single conversation. If those changes break something, Ctrl+Z won’t save you. You need a way to rewind your entire project to its last working state, instantly.

The Google Docs Analogy

You know how Google Docs automatically saves your document and keeps a version history? You can go to File -> Version history -> See version history and see every change that was ever made, by whom, and when. You can even restore an old version.

Git does the same thing, but for your entire project.

Every time you make a “save point” in git (called a commit), it takes a snapshot of all your files. You can always go back to any previous snapshot. Committed history is very hard to lose, and you can reliably restore prior commits.

Uncommitted work is not protected

Git only protects work you have committed. If you make changes but never commit them, those changes can be lost. Think of it like writing on a whiteboard versus writing in a permanent notebook — the notebook (committed history) is safe, but the whiteboard (uncommitted work) can be erased at any time.

Google DocsGit
Auto-saves your documentYou manually save (commit) your project
Version history shows all changesgit log shows all commits
You can restore old versionsGit lets you restore older versions
Shows who made which changeCommits record who and when
Share with collaboratorsPush to GitHub for collaboration
💡Think of commits as save points

If you have ever played a video game, commits are like save points — you would not attempt a hard level without saving first. If gaming is not your thing, think of it as undo history on steroids: instead of undoing one action at a time, you can jump back to any previous state of your entire project instantly.

🔍Why not just use Dropbox or Google Drive?

Cloud storage like Dropbox or Google Drive backs up your files, but it only stores the current version (or a limited history). Git tracks what changed between versions, who changed it, and why. You can compare any two points in history line by line, revert individual files, and work on experimental changes without affecting the main project. For code projects — especially when an AI tool is making sweeping changes — this precision matters far more than a simple backup.

Why You Need This as an Orchestrator

When you’re working with AI CLI tools, you’re making lots of changes quickly. Claude Code might edit 15 files in one go. Gemini CLI might refactor your entire project structure. Sometimes those changes are exactly right. Sometimes they’re not.

With git:

  • Before a big AI task: Save a commit. “Here’s my working project.”
  • After the AI makes changes: If it’s great, commit again. If it’s broken, revert to the previous commit.
  • Experimenting: Try something wild. If it doesn’t work, go back with one command.

Without git, you’re flying without a safety net. With git, you can always get back to a known-good state.

🧬In Your Field: Biotechclick to expand

Imagine you use Claude Code to write a Python script that analyzes gene expression data. It works great. Then you ask it to add a new visualization — and the refactoring breaks the original analysis. With git, you run one command and you’re back to the working version. Without git, you’re re-doing an hour of prompt engineering. Many bioinformatics pipelines live in git repositories already — learning these basics makes you fluent in how your computational colleagues work.

📊In Your Field: MIS / Businessclick to expand

Think of git like an audit trail for your project files. In business, every decision has a paper trail. Git gives you that same accountability for technical work — who changed what, when, and why. When your team builds dashboards or automates reports with AI tools, git ensures you can always roll back a bad deployment to yesterday’s working version. It’s change management for code.

🏛️In Your Field: Government / State Devclick to expand

Government projects often require documented change history for compliance and auditing. Git provides that automatically — every commit is timestamped with an author and a description. When an AI tool modifies a configuration file or a data pipeline, git keeps a permanent record. If a supervisor asks “what changed and when?” you can answer precisely, not from memory.

What Is Git?

Git is a version control system. It’s a program that runs on your computer and tracks changes to files in a folder. It was created in 2005 by Linus Torvalds (who also created Linux) and is used by the vast majority of modern software projects.

GitHub is a website that hosts git repositories online. It’s like Google Drive for git projects. Git works on your computer; GitHub stores your projects in the cloud so you can share and collaborate.

TermWhat it is
gitThe program that tracks changes on your computer
GitHubA website that hosts your git projects online
Repository (repo)A project folder that git is tracking
CommitA saved snapshot of your project
BranchA separate line of work (like a parallel universe)
PushUpload your commits to GitHub
PullDownload new commits from GitHub
🔍Git vs. GitHub vs. GitLab vs. Bitbucket

Git is the tool. GitHub, GitLab, and Bitbucket are all websites that host git repositories — like how email is the protocol and Gmail, Outlook, and Yahoo are services that use it. We’ll use GitHub in this course because it’s the most popular. Core git commands are the same across hosts; authentication and web UI workflows differ slightly.

What Life Looks Like Without Git

Let’s make this concrete. Here’s a common scenario without version control:

my-project/
analysis.py
analysis_v2.py
analysis_v2_FINAL.py
analysis_v2_FINAL_really_final.py
analysis_v2_FINAL_really_final_fixed.py
analysis_backup_jan15.py

Sound familiar? Everyone has done this. It works for one file, barely. It falls apart completely when your project has dozens of files across multiple folders. Which “final” version actually works? Which backup matches which version of the other files?

Git eliminates this chaos. You keep one copy of each file. Git tracks every version internally. Your folder stays clean, and you can access any previous version with a single command.

Check If Git Is Installed

Open your terminal and run:

Terminal window
git --version

If you see a version number (like git version 2.43.0), you’re set.

If not, install it:

  • macOS: Running git --version usually prompts you to install Apple’s Command Line Tools automatically — just click “Install” on the pop-up. If it does not appear, run xcode-select --install.
  • Windows (WSL): sudo apt install git
  • Linux: sudo apt install git (Ubuntu/Debian) or sudo dnf install git (Fedora)
If the install fails

Try running sudo apt update first (Linux/WSL), then retry the install command. After installing, close and reopen your terminal, then verify with git --version. If you are still stuck, check the official Git install docs.

TRY ITCheck which version of git is installed on your system
$

One-Time Setup

After installing, tell git who you are (this information is recorded with each commit as author metadata):

Terminal window
git config --global user.name "Your Name"
git config --global user.email "your@email.com"

Keep the quotation marks, but replace Your Name and your@email.com with your actual name and email. Use the same email you’ll use for your GitHub account. This only needs to be done once — git remembers these settings.

You can verify your settings any time:

Terminal window
git config --global --list
TRY ITSet your git username to 'Jane Doe' (using the global config)
$
🔧

When Things Go Wrong

Use the Symptom → Evidence → Request pattern: describe what you see, paste the error, then ask for a fix.

Symptom
git --version says 'command not found'
Evidence
bash: git: command not found
What to ask the AI
"I'm on [macOS/WSL/Linux] and git isn't installed. What's the install command for my system?"
Symptom
Not sure if setup worked after running git config
Evidence
No output after running git config commands
What to ask the AI
"I ran git config but got no output. How do I verify my git name and email are set correctly?"
Symptom
Accidentally set the wrong name or email
Evidence
git config --global --list shows wrong values
What to ask the AI
"I set the wrong email in git config. How do I change it?"

What’s Next?

You’ve installed git and configured it. In the next lesson, you’ll create your first repository and make your first commit — the actual “save point” that protects your work. Everything from here is hands-on.

Key Takeaways

  • Git is your safety net. It lets you save snapshots of your entire project and rewind to any one of them.
  • Commits are save points. Before any big AI-driven change, commit your work so you can always go back.
  • Git is local; GitHub is cloud. Git tracks changes on your machine. GitHub backs them up online.
  • No more “final_v2_REALLY_final.” Git keeps every version internally so your project folder stays clean.
  • You already understand the concept. If you’ve used Google Docs version history, undo/redo, or a lab notebook, you know the idea — git just makes it systematic.
  • Setup is a one-time task. Install git, set your name and email, and you’re ready for the next lesson.
KNOWLEDGE CHECK

What is a git commit?

KNOWLEDGE CHECK

Why is git especially important when working with AI CLI tools?