AI-Assisted Programming for PhD Researchers
Helmut Schmidt University, August 2026
Pick the line for your system:
Windows: the installer brings Git Bash. Run every lab command there.
Your turn: confirm Git works, then tell it who you are.
Use the same email you will use on GitHub: it links your commits to your account.
Your turn: confirm the uv you installed this morning is working.
If uv didn’t land during setup, one command fixes it now:
Every lab runs Python through uv run, nothing else to configure.
.git directorygit init: start tracking a new folder of your owngit clone URL: copy an existing repository to your machineYour turn: get the starter project and look around.
The log output is the project’s history: every commit before you arrived.
git status: what have I changed?git add: put changes in the staging areagit commit: record what is staged, with a messageThe staging area is a shopping cart: you fill it deliberately, then check out.
Your turn: create notes.md in Zed with one line about the project state, or from the shell, then commit it.
Your commit is now the newest line in the history.
git add -p walks you through changes hunk by hunkgit log --oneline --graph: compact history with branch structuregit diff: changes you have not staged yetgit diff --staged: changes about to go into your next commitgit show HEAD: the full content of the last commitThis is the tool for reviewing what an agent actually did.
Your turn: read the starter repo’s history.
Scroll the log and find the commit where the data set was first added.
Match the command to how far you want to go back:
| Command | Undoes |
|---|---|
git restore <file> |
An unstaged change in your working file |
git restore --staged <file> |
Staging: keeps the edit, unstages it |
git reset --soft HEAD~1 |
The last commit: keeps its changes staged |
In Zed, git: restore file (Command Palette) does the first row.
Your turn: break a file on purpose, then bring it back.
Nothing is scary while your last commit is safe.
Never rewrite history you have already pushed or shared: others may have built on it. Everything still local and unpushed is yours to rewrite freely.
main stays cleanmain never knewFour commands: branch, work, return, merge.
Your turn: run the full branch cycle once.
(-C moves your main to that state, safe as long as nothing is pushed.)
No shame in catching up: the goal is the next exercise, not pride.
git push sends your commits up; git pull brings others’ downstatus, add, commit), so you know exactly what every button does.git directory; nothing here is a different GitZed’s Git support does not replace the terminal: for anything it does not cover (interactive rebase, cherry-pick, …), drop into the integrated terminal and use the commands you already know.
git panel: toggle focus, or click the Git icon in the status barspace to toggle staging on the selected file (git: toggle staged)git: stage all / git: unstage all: stage or clear everything at oncecmd-enter (macOS) or ctrl-enter (Windows/Linux)Same shopping cart, same staging area, just checkboxes instead of git add.
If you stage nothing, Zed stages all tracked files and commits them. Check the panel before you hit commit.
git: diff opens the Project Diff (ctrl-g d on macOS, Windows, and Linux)git diff and git diff --stagededitor: open excerpts jumps from an excerpt straight to its source filecmd-d / ctrl-d selects the next match of the word under your cursorcmd-shift-l / ctrl-shift-l (editor: select all matches) selects every match at oncegit: branch creates a new branch; git: switch (or git: checkout branch) opens a picker to switch to an existing oneYour turn: redo status → stage → commit → diff, entirely inside Zed, in aiprog-lab-starter.
notes.md in Zed’s editornotes.md shows up as changedctrl-g d) and confirm there is nothing left to reviewLecture II: Version Control with Git | Dr. Tobias Vlćek | Home