Git: save points
Git: mainly for the agent. Very, very good for you too.
What git is
- Git records the history of a folder: every change, when, and why.
- Software can’t be built without it: millions of lines, thousands of people.
- Every change can be seen before it’s accepted, and undone after.
- Many people work at once, and git merges their changes.
What a save point is
- Commit copies every file into the hidden
.git folder, with a note.
- Revert copies a save point back over your files.
Where git comes from
The tool almost all software is built with.
Almost every developer uses it
Version control used by professional developers. Stack Overflow developer survey, 2022; 53,374 answers.
GitHub: where git lives online
Developers on GitHub, as GitHub announced them. Microsoft bought GitHub in 2018 for $7.5 billion.
Mainly for the agent
It changes 40 files in 30 seconds. You can’t check that by looking.
“What changed?”
paper/methods.md
− We interviewed 14 founders.
+ We interviewed 12 founders; the two pilot interviews are dropped.
tables/table2.csv
− Mean age, 41.2
+ Mean age, 40.8
notes/log.md
+ 20 Oct: dropped the pilots, reran Table 2.
Every file, every line, in one list.
The agents insist on it
Codex requires commands to run inside a Git repository to prevent destructive changes.
OpenAI’s manual for Codex. And what it says in a folder without git:
codex exec "check these facts"
Not inside a trusted directory and --skip-git-repo-check was not specified.
Very good for you too
- Nerve. Let it try something bold. Hate it? Revert.
- One file, every version. No more
paper_v3_FINAL_jm.docx.
- A history you can ask about. “When did we drop the pilots, and why?”
Track Changes, for a whole folder, with a note on every change.
A first save point
In your practice folder, with the agent running:
- “Set up git here. My name is …, my email is …”
- “Make a file notes.md with one line about my research. Commit it.”
- “Add a second line.” Then: “What changed since the last commit?”
Three minutes. Prompts with copy buttons: handout, section 2.
Save points on a line
- Every commit is the whole folder, with a note.
- Not happy since the last one? Revert.
Undo
- “Revert to the last commit.” The second line is gone.
- “Show me the history.”
Done early? “Make a branch called experiment, add a line there, then switch back to main. Where did the line go?”
Isn’t this just OneDrive?
Undo the agent’s 40 edits
OneDrive is a backup. Git is a lab notebook. Keep both.
Keep things out: .gitignore
- Ignore before the first commit. After that, it’s in the history.
- Ignored by git is not hidden from the agent. That’s the next deck.
A research project
A made-up study of founders: interviews, a survey, papers, a draft.
- Get it: the download prompt is in the handout, section 2.
- “Go into founders-study. Set up git, but don’t commit yet. Tidy the folders, and show me the plan first.”
- “Write a .gitignore. Explain each line in plain words.”
- “Commit. What did git leave out, and why?”
Check: “If I pushed this to GitHub, would anything private go along?”
The cloud: remote, push, pull
- No remote? Then nothing leaves your laptop.
Five words, one picture
You never type a git command. But the agent uses these words.
You’ll hear them back
Commit this.
Committed a1b2c3d: "Drop pilot interviews, rerun Table 2".
Is there a remote?
No remote configured. Everything is local.
Put it on GitHub as a private repository, and push.
Created founders-study (private). Pushed 3 commits to origin/main.
Careful: revert to the last commit goes back to it. Revert the last commit undoes it.
Unsure what a word means? Ask.
repodifflogbranchmerge
cloneoriginmainHEADstash
rebaseforktagworktree
pull request.gitignore
What's a worktree? Two sentences, for a professor.
A second working folder for the same repository, on its own branch. Two agents can work on one project at once without touching each other's files.
Your turn: pick any word above, and ask.
GitHub: what it’s for
Setup, co-authors and a live demo: the GitHub deck.
A free web page: GitHub Pages
- A folder becomes a web page. Free.
- This course’s page is one.
- Public is fine for teaching pages. Private? Free academic plan.
Publish this folder as a web page with GitHub Pages.
What people ask about GitHub
Who can see it?Private: you and the people you invite.
Is my data safe there?Same rules as OneDrive: nothing personal or confidential.
Can I delete it later?It stays in the history. Keep data out from the start.
Does it train AI on it?Copilot won't train on repositories it indexes, GitHub says.
Quick answers
Word and Excel files?Every version is kept, but no line-by-line "what changed".
A OneDrive folder?My advice: keep git projects outside it.
Claude Code's own undo (Esc twice)?It misses files that commands moved or deleted. Git doesn't.
Committed something by mistake?Ask before you push: it can still come out of the history.