Repository navigation
Expand file tree
/
Copy pathindex.html
More file actions
484 lines (390 loc) · 30.6 KB
/
Copy pathindex.html
File metadata and controls
484 lines (390 loc) · 30.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="A plain-English guide to using Git and GitHub with Claude Code, for teachers and content creators. Know what you are approving, read the diff before you say yes, keep secrets out, and undo mistakes without panic.">
<meta property="og:title" content="GitHub with the panic">
<meta property="og:description" content="Claude Code does the git work. You stay in charge: what to approve, what to check, and how to undo a mistake.">
<title>GitHub with the panic — v1</title>
<style>
:root{
--bg:#0f1115; --card:#171a21; --card2:#1d212a; --ink:#e8eaf0; --dim:#9aa1b0;
--line:#2a2f3a; --accent:#7dd3a0; --warn:#ffb454; --bad:#ff7b72; --link:#79b8ff;
}
*{box-sizing:border-box;min-width:0}
html,body{overflow-x:hidden;max-width:100%}
img,table,pre,.anat{max-width:100%}
html{scroll-behavior:smooth}
body{margin:0;background:var(--bg);color:var(--ink);
font:16px/1.65 -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,sans-serif;
padding:0 0 60px}
.wrap{max-width:800px;margin:0 auto;padding:0 20px}
nav{position:sticky;top:0;z-index:9;background:rgba(15,17,21,.94);
backdrop-filter:blur(8px);border-bottom:1px solid var(--line);padding:9px 0}
nav .wrap{display:flex;gap:14px;flex-wrap:wrap;font-size:.82rem}
nav a{color:var(--dim);text-decoration:none;white-space:nowrap}
nav a:hover{color:var(--accent)}
header{padding:44px 0 26px;border-bottom:1px solid var(--line);margin-bottom:30px}
h1{font-size:1.9rem;line-height:1.25;margin:0 0 12px;letter-spacing:-.02em}
.sub{color:var(--dim);font-size:1.02rem;margin:0}
h2{font-size:1.32rem;margin:48px 0 14px;letter-spacing:-.01em;scroll-margin-top:56px}
h2 .n{color:var(--accent);font-variant-numeric:tabular-nums;margin-right:10px}
h3{font-size:1.02rem;margin:26px 0 8px;color:var(--accent)}
p{margin:0 0 14px}
.card{background:var(--card);border:1px solid var(--line);border-radius:12px;
padding:20px 22px;margin:18px 0}
.big{background:linear-gradient(180deg,#1b2a22,#171a21);border-color:#2f5a44}
.ex{background:linear-gradient(180deg,#1a2130,#171a21);border-color:#31435f}
.quiet{color:var(--dim);font-size:.94rem}
code{background:var(--card2);padding:2px 7px;border-radius:5px;font-size:.9em;
font-family:ui-monospace,SFMono-Regular,Menlo,monospace;color:#c8d3e8;
word-break:break-word}
.btn{display:inline-block;background:#238636;color:#fff;padding:3px 11px;
border-radius:6px;font-size:.85rem;font-weight:600}
.step{display:flex;gap:15px;margin:0 0 18px;align-items:flex-start}
.num{flex:0 0 29px;height:29px;border-radius:50%;background:var(--accent);color:#0f1115;
display:flex;align-items:center;justify-content:center;font-weight:700;font-size:.9rem}
.step > div:last-child{flex:1;padding-top:2px}
table{width:100%;border-collapse:collapse;margin:14px 0;font-size:.94rem}
th,td{text-align:left;padding:10px 12px;border-bottom:1px solid var(--line);vertical-align:top}
th{color:var(--dim);font-weight:600;font-size:.82rem;text-transform:uppercase;letter-spacing:.04em}
td:first-child{font-family:ui-monospace,monospace;color:#c8d3e8}
.flag{border-left:3px solid var(--warn);padding-left:16px;margin:18px 0;color:#f0d9b5}
.stop{border-left:3px solid var(--bad);padding-left:16px;margin:18px 0;color:#ffc9c4}
.good{border-left:3px solid var(--accent);padding-left:16px;margin:18px 0;color:#c9e8d5}
.yes{color:var(--accent);font-weight:600}
.no{color:var(--bad);font-weight:600}
ul{margin:0 0 14px;padding-left:22px}
li{margin-bottom:7px}
.anat{background:var(--card2);border:1px solid var(--line);border-radius:10px;
padding:15px;font-family:ui-monospace,monospace;font-size:.8rem;line-height:1.85;
overflow-x:auto;white-space:pre;color:var(--dim)}
.anat b{color:var(--ink);font-weight:600}
.anat-m{display:none}
.anat-m li{margin-bottom:10px}
.anat .hl{color:var(--accent);font-weight:600}
footer{margin-top:52px;padding-top:22px;border-top:1px solid var(--line);
color:var(--dim);font-size:.88rem}
a{color:var(--link);overflow-wrap:anywhere;word-break:break-word}
.card p,.card{overflow-wrap:anywhere}
.ver{display:inline-block;font-size:.72rem;background:var(--card2);color:var(--dim);
padding:2px 9px;border-radius:20px;border:1px solid var(--line);margin-left:8px;
vertical-align:middle}
@media(max-width:560px){
h1{font-size:1.5rem}
.wrap{padding:0 15px}
nav .wrap{font-size:.76rem;gap:10px}
td:first-child{white-space:normal}
.anat{display:none}
.anat-m{display:block}
th,td{padding:9px 8px;font-size:.9rem}
.card{padding:16px 15px}
table{display:block;overflow-x:auto}
}
</style>
</head>
<body>
<nav><div class="wrap">
<a href="#s1">1 Claude Code</a>
<a href="#s2">2 First commit</a>
<a href="#s3">3 Good commits</a>
<a href="#s4">4 Branches</a>
<a href="#s5">5 Pull requests</a>
<a href="#s6">6 Signing in</a>
<a href="#s7">7 Private / public</a>
<a href="#s8">8 Secrets</a>
<a href="#s9">9 Worktrees</a>
<a href="#s10">10 Undo</a>
<a href="#s11">11 Pushing</a>
<a href="#s12">12 Hold off</a>
<a href="#s13">13 Glossary</a>
</div></nav>
<div class="wrap">
<header>
<h1>GitHub with the panic <span class="ver">v1</span></h1>
<p class="sub">The sequel to <a href="https://github.com/iteachc/github-without-panic">GitHub without the panic</a> (the prequel). That one got you through the door. This one is for when Claude Code is sitting in your project folder doing the git work, and you would like to know what you are saying yes to.</p>
</header>
<div class="card big">
<p style="margin:0"><strong>The whole guide in one line:</strong> let Claude type the commands, but you read the <strong>diff</strong> before any commit and you decide <strong>when</strong> anything leaves your laptop. Everything else is detail, and almost everything is undoable.</p>
</div>
<div class="card">
<h3 style="margin-top:0">In short</h3>
<ol style="margin:0;padding-left:20px">
<li><strong>Claude Code is an assistant in your terminal.</strong> It reads your files and runs commands, but it asks before it does anything that changes things. Each prompt is a yes/no from you.</li>
<li><strong>A commit is a saved snapshot.</strong> Ask Claude to commit, and ask to see what changed first.</li>
<li><strong>Never overwrite the original.</strong> Save fixes as a new, versioned copy. Git then keeps both.</li>
<li><strong>Private by default.</strong> Make something public only as a deliberate, scanned, sanitised copy.</li>
<li><strong>Secrets, client files and student data never get committed.</strong> Not even once, not even "temporarily".</li>
<li><strong>Pushing is the moment it leaves your machine.</strong> Say "commit but don't push" until you have looked.</li>
<li><strong>Panicked?</strong> Stop, and ask Claude to explain before it fixes anything. Two flags are dangerous: <code>--hard</code> and <code>--force</code>.</li>
</ol>
</div>
<div class="card ex">
<h3 style="margin-top:0">The running example</h3>
<p>Throughout, we follow a fictional tutor and a small team of content creators. They make practice-test slide decks. Their loop looks like this:</p>
<ol style="margin:0 0 6px;padding-left:20px">
<li>Download a deck (<code>.pptx</code>) into a project folder.</li>
<li>Claude Code reviews it and writes <code>Review.md</code> and <code>Fixes Log.md</code>.</li>
<li>Fixes go into a <strong>versioned copy</strong> of the deck. The original is never touched.</li>
<li>Commit, then push to a <strong>private</strong> repo called <code>my-deck-reviews</code>.</li>
<li>Later, a <strong>sanitised public toolkit</strong> is shared with other teachers.</li>
</ol>
<p class="quiet" style="margin:0">Every name, file and folder in this guide is made up. Swap in your own: <code>your-name</code>, <code>my-deck-reviews</code>, and so on.</p>
</div>
<h2 id="s1"><span class="n">1</span>What Claude Code is, and what it is asking you</h2>
<p>Claude Code is an AI assistant that lives in a terminal window, inside one folder. Unlike a chat window, it can <em>do</em> things: read the files in that folder, edit them, and run commands such as <code>git</code>.</p>
<p>That is also why it asks permission. Before it edits a file or runs a command, it stops and shows you what it wants to do. You choose.</p>
<table>
<tr><th>You see</th><th>What it means</th></tr>
<tr><td>Read a file</td><td>Looking only. Safe. Usually allowed without asking.</td></tr>
<tr><td>Edit / write a file</td><td>It will change something in your folder. Check the file name. Git can undo it if you have committed.</td></tr>
<tr><td>Run <code>git status</code>, <code>git diff</code>, <code>git log</code></td><td>Looking only. Safe.</td></tr>
<tr><td>Run <code>git add</code>, <code>git commit</code></td><td>Saves a snapshot on your laptop. Reversible. Fine.</td></tr>
<tr><td>Run <code>git push</code></td><td>Sends your work to GitHub. <strong>Slow down and read.</strong></td></tr>
<tr><td>Run <code>gh repo create</code></td><td>Creates something on GitHub. Check public vs private.</td></tr>
<tr><td>Anything with <code>--hard</code>, <code>--force</code>, or <code>rm</code></td><td>Can destroy work. Say no, then ask why it needs that.</td></tr>
</table>
<div class="good">
<strong>The habit:</strong> read the one line it is about to run. If you can't tell what it does, answer <em>no</em> and type: <em>"Explain what that command does and what could go wrong, in plain English. Don't run it yet."</em>
</div>
<p>Many people choose "allow this kind of command for the session" for the harmless read-only ones, so they are not prompted fifty times. Do that for <code>git status</code> and <code>git diff</code>. Do not do it for <code>push</code>.</p>
<h2 id="s2"><span class="n">2</span>Starting a project: your first commit</h2>
<p>A <strong>repo</strong> starts life as an ordinary folder. <code>git init</code> turns it into a folder with a memory. A <strong>commit</strong> is one saved snapshot of it.</p>
<div class="step"><div class="num">1</div><div>Make a folder, e.g. <code>my-deck-reviews</code>, and drop the first deck into it.</div></div>
<div class="step"><div class="num">2</div><div>Open Claude Code in that folder and type the prompt below.</div></div>
<div class="step"><div class="num">3</div><div>Approve the commands one by one, reading each.</div></div>
<div class="card">
<p class="quiet" style="margin:0 0 6px">You type:</p>
<p style="margin:0"><em>"This folder is a new project. Set it up as a git repo, then show me what would go into the first commit before you commit anything."</em></p>
</div>
<p>A sensible Claude does roughly this, asking before each step:</p>
<div class="anat"><b>git init</b> <span class="hl"># turns the folder into a repo</span>
<b>git status</b> <span class="hl"># lists the files git can see</span>
<b>git add .</b> <span class="hl"># stages them (picks them for the snapshot)</span>
<b>git commit -m "Add first deck"</b> <span class="hl"># takes the snapshot</span></div>
<ul class="anat-m">
<li><code>git init</code> turns the folder into a repo</li>
<li><code>git status</code> lists the files git can see</li>
<li><code>git add .</code> stages them (picks them for the snapshot)</li>
<li><code>git commit -m "..."</code> takes the snapshot</li>
</ul>
<div class="flag">
<strong>Watch for <code>git add .</code></strong> — the dot means "everything". Before you approve, ask: <em>"What files is that adding?"</em> Section 8 is why.
</div>
<p>Nothing has gone online. All of this lives on your laptop, in a hidden folder called <code>.git</code>. Don't delete it; it <em>is</em> the memory.</p>
<h2 id="s3"><span class="n">3</span>Commits, good messages, and reading the diff</h2>
<p>A <strong>diff</strong> is the list of what changed since the last snapshot: lines in red were removed, lines in green were added. It is the single most useful thing you can read as a non-programmer, because it answers "what is about to be saved?"</p>
<div class="card">
<p class="quiet" style="margin:0 0 6px">You type:</p>
<p style="margin:0"><em>"Show me the diff of what you changed, in plain English, and wait for my OK before committing."</em></p>
</div>
<p>Claude runs <code>git diff</code>, then summarises. For the deck example it might say: <em>"Three files changed: Review.md is new (a 40-line review), Fixes Log.md is new (six entries), and the v2 deck is a new file. The original deck is unchanged."</em> That last sentence is what you are checking for.</p>
<h3>What a good commit message looks like</h3>
<p>A message is a note to your future self. Short first line, saying what and why.</p>
<table>
<tr><th>Poor</th><th>Good</th></tr>
<tr><td>update</td><td>Review Grade 7 acids deck; log six fixes</td></tr>
<tr><td>fixes</td><td>Add v2 of acids deck with Q3 answer key corrected</td></tr>
<tr><td>stuff</td><td>Move scratch notes out of the repo</td></tr>
</table>
<p>You can simply ask: <em>"Write the commit message in the style of the existing ones."</em> It can read <code>git log</code> to match.</p>
<div class="good">
<strong>The rule for your team's decks:</strong> never overwrite the original. Fixes go into a new file with a version tag in its name, e.g. <code>Acids Deck (reviewed v2).pptx</code>. Git can already restore old versions, but a clear file name saves a conversation when someone opens the folder.
</div>
<h2 id="s4"><span class="n">4</span>Branches</h2>
<p>A <strong>branch</strong> is a separate line of work. The main line is usually called <code>main</code>. Think of a branch as a photocopy of the project that you can scribble on freely; if you like the result you merge it back, if you don't you throw the copy away.</p>
<p>Use one whenever a change is bigger than a quick fix, or when several people are working at once. In the example, each creator takes their own branch per deck: <code>review-acids-g7</code>, <code>review-metals-g7</code>.</p>
<div class="card">
<p class="quiet" style="margin:0 0 6px">You type:</p>
<p style="margin:0"><em>"Make a new branch called review-acids-g7 and switch to it. Do the review work there, not on main."</em></p>
</div>
<div class="anat"><b>git switch -c review-acids-g7</b> <span class="hl"># create and move to the branch</span>
<b>git branch</b> <span class="hl"># which branch am I on? (starred)</span>
<b>git switch main</b> <span class="hl"># go back</span></div>
<ul class="anat-m">
<li><code>git switch -c review-acids-g7</code> creates and moves to the branch</li>
<li><code>git branch</code> shows which branch you are on (starred)</li>
<li><code>git switch main</code> goes back</li>
</ul>
<p class="quiet">Lost? Ask: <em>"Which branch am I on, and is there any work not saved?"</em></p>
<h2 id="s5"><span class="n">5</span>Pull requests</h2>
<p>A <strong>pull request</strong> (PR) is a polite way of saying: <em>"I did some work on a branch. Please look at it before it joins main."</em> It is a page on GitHub where the changes are shown as a diff, and where others can comment.</p>
<p>Useful even if you work alone: it gives you one more look at the diff before anything changes on <code>main</code>.</p>
<div class="card">
<p class="quiet" style="margin:0 0 6px">You type:</p>
<p style="margin:0"><em>"Open a pull request from this branch into main. Write the description for a teacher, not an engineer: what changed and which slides I should check."</em></p>
</div>
<p>Claude uses the GitHub command-line tool, <code>gh</code>:</p>
<div class="anat"><b>gh pr create</b> --title "Review: G7 acids deck" --body "..." <span class="hl"># opens the PR</span>
<b>gh pr view --web</b> <span class="hl"># opens it in your browser</span></div>
<ul class="anat-m">
<li><code>gh pr create --title "..." --body "..."</code> opens the PR</li>
<li><code>gh pr view --web</code> opens it in your browser</li>
</ul>
<p>Open the link, read the "Files changed" tab, and press the green <span class="btn">Merge</span> button yourself when you are happy. Merging is your decision, not Claude's.</p>
<h2 id="s6"><span class="n">6</span>Signing in: <code>gh auth login</code></h2>
<p>Before <code>gh</code> can do anything on GitHub, it needs to know who you are. You do this once per computer.</p>
<div class="step"><div class="num">1</div><div>In a normal terminal (not inside Claude's chat) type <code>gh auth login</code>.</div></div>
<div class="step"><div class="num">2</div><div>Choose <strong>GitHub.com</strong>, then <strong>HTTPS</strong>, then <strong>Login with a web browser</strong>.</div></div>
<div class="step"><div class="num">3</div><div>It shows a short one-time code. Your browser opens; paste the code and approve.</div></div>
<div class="step"><div class="num">4</div><div>Check it worked: <code>gh auth status</code> should say you are logged in.</div></div>
<div class="flag">
<strong>Do this part yourself.</strong> Sign-in is your identity. Don't paste passwords or tokens into a chat with Claude, and if it ever asks you to, stop. The browser flow above never needs you to.
</div>
<h2 id="s7"><span class="n">7</span>Private vs public, and sharing a sanitised copy</h2>
<table>
<tr><th>Private</th><th>Public</th></tr>
<tr><td>Only you and people you invite</td><td>Anyone on the internet, forever (search engines, copies)</td></tr>
<tr><td>Right for working drafts, client decks, anything unfinished</td><td>Right for finished, generic, share-worthy material</td></tr>
</table>
<p>The team starts private. Their working repo, <code>my-deck-reviews</code>, contains real review history, half-fixed decks and notes about who asked for what. None of that should be public.</p>
<p>But the <em>method</em> is worth sharing: the review checklist, the prompts, the folder layout. So they make a <strong>sanitised public copy</strong>, a new, separate project. This is not a switch from private to public. Flipping the visibility of the old repo would publish its whole history, including everything deleted months ago.</p>
<h3>The recipe</h3>
<div class="step"><div class="num">1</div><div><strong>Copy only the shareable files</strong> into a new folder, e.g. <code>deck-review-toolkit</code>. Not the whole project.</div></div>
<div class="step"><div class="num">2</div><div><strong>Fresh history.</strong> Run <code>git init</code> in the new folder. Do not copy the <code>.git</code> folder. The public repo starts with one clean commit, and old messages and file names stay behind.</div></div>
<div class="step"><div class="num">3</div><div><strong>Neutral identity.</strong> Every commit is stamped with a name and email. Set a project-only one so your real details aren't printed on a public page:
<div class="anat" style="margin-top:8px"><b>git config user.name</b> "deck-review-toolkit contributors"
<b>git config user.email</b> "noreply@example.com"</div></div></div>
<div class="step"><div class="num">4</div><div><strong>Run a privacy scan</strong> before the first commit. Search every file for things that should not be there, case-insensitively: your email address, your school or company name, your username, local folder paths, links to private documents, and anything that looks like a key.
<div class="anat" style="margin-top:8px"><b>grep -rniE</b> "@your-email-provider|your-school|your-username|your-home-folder|your-private-doc-link|your-token-prefix" .</div></div></div>
<div class="step"><div class="num">5</div><div><strong>Read the results with Claude.</strong> Fix every hit, then scan again until it comes back empty.</div></div>
<div class="step"><div class="num">6</div><div><strong>Commit, but don't publish yet.</strong> Look at the file list one more time yourself. Then, and only then, create the public repo.</div></div>
<div class="card">
<p class="quiet" style="margin:0 0 6px">You type:</p>
<p style="margin:0"><em>"I want a public copy of the shareable parts of this project in a new folder called deck-review-toolkit. Fresh git history, a neutral git identity (noreply@example.com), and run a case-insensitive grep for my name, email, school, local paths and any tokens before you commit. Show me any hits. Do not create a GitHub repo or push."</em></p>
</div>
<div class="stop">
<strong>Remember:</strong> anything that was ever public may already be copied. Deleting a repo later doesn't un-ring that bell. A scan is cheap; an apology to a student's parent is not.
</div>
<h2 id="s8"><span class="n">8</span><code>.gitignore</code> and secrets</h2>
<p>Git saves everything it can see. A file named <code>.gitignore</code> lists things it must pretend it can't see. Claude can write it for you.</p>
<p>Three categories that must never be committed:</p>
<ul>
<li><strong>Secrets</strong> — passwords, API keys, tokens (they are long random-looking strings, often starting with a short prefix like <code>sk-</code>, or sit in a file called <code>.env</code>).</li>
<li><strong>Client files</strong> — an organisation's paid work, their branding, anything under an agreement.</li>
<li><strong>Student data</strong> — names, marks, class lists, photos, parent contacts. Even a spreadsheet "for just this week".</li>
</ul>
<div class="card">
<p class="quiet" style="margin:0 0 6px">You type:</p>
<p style="margin:0"><em>"Create a .gitignore for this project. Ignore .env files, anything in a folder called private/, student-marks spreadsheets, and temporary files. Then tell me whether any of those are already committed."</em></p>
</div>
<div class="anat"><span class="hl"># .gitignore</span>
.env
private/
*.xlsx
~$*
.DS_Store</div>
<ul class="anat-m">
<li><code>.env</code></li>
<li><code>private/</code></li>
<li><code>*.xlsx</code></li>
<li><code>~$*</code> and <code>.DS_Store</code></li>
</ul>
<div class="stop">
<strong>If a secret was committed, ignoring it later is too late.</strong> It is still in the history. Treat the token as stolen: revoke it on the website that issued it and make a new one, then ask Claude how to remove it from history. Don't push in the meantime.
</div>
<p>Good question to ask before every first push: <em>"Is there anything in this commit that I wouldn't want a stranger to read?"</em></p>
<h2 id="s9"><span class="n">9</span>Worktrees: a parallel copy</h2>
<p>A <strong>worktree</strong> is a second copy of the project in another folder, linked to the same repo and sitting on a different branch. It lets you or Claude try something risky without disturbing the folder you are working in.</p>
<p>In the example, the tutor keeps teaching from the main folder while Claude reviews a new deck in a worktree. Nothing in the main folder moves under their feet.</p>
<div class="card">
<p class="quiet" style="margin:0 0 6px">You type:</p>
<p style="margin:0"><em>"Do this review in a separate worktree on its own branch, so my main folder isn't touched. Tell me where it is when you're done."</em></p>
</div>
<div class="anat"><b>git worktree add ../review-copy review-acids-g7</b> <span class="hl"># make the parallel copy</span>
<b>git worktree list</b> <span class="hl"># see all copies</span>
<b>git worktree remove ../review-copy</b> <span class="hl"># tidy up when merged</span></div>
<ul class="anat-m">
<li><code>git worktree add ../review-copy review-acids-g7</code> makes the parallel copy</li>
<li><code>git worktree list</code> shows all copies</li>
<li><code>git worktree remove ../review-copy</code> tidies up when merged</li>
</ul>
<p class="quiet">Claude Code can do this itself if you ask. If something goes wrong in the copy, delete it. The main folder is fine.</p>
<h2 id="s10"><span class="n">10</span>"I panicked": undo recipes</h2>
<p>Good news: once something is <strong>committed</strong>, it is very hard to truly lose. The first move is always the same: <strong>stop, breathe, and ask Claude to look before it touches anything.</strong></p>
<div class="card">
<p class="quiet" style="margin:0 0 6px">You type:</p>
<p style="margin:0"><em>"Something went wrong. Don't change anything yet. Run git status and git log, and explain in plain English what state we're in."</em></p>
</div>
<table>
<tr><th>Situation</th><th>Recipe</th><th>Risk</th></tr>
<tr><td>Typo in the last commit message, or forgot one file</td><td><code>git commit --amend</code></td><td class="yes">Safe if not pushed yet</td></tr>
<tr><td>A commit that is already shared turned out wrong</td><td><code>git revert <commit></code> (adds a new commit that cancels it)</td><td class="yes">Safe. History stays honest.</td></tr>
<tr><td>I messed up one file, want it back as it was</td><td><code>git restore <file></code></td><td class="no">Discards unsaved changes to that file</td></tr>
<tr><td>I want to un-commit but keep my work</td><td><code>git reset --soft HEAD~1</code></td><td class="yes">Safe. Work stays staged.</td></tr>
<tr><td>"I lost a commit!" / "I reset too far"</td><td><code>git reflog</code>, find it, then <code>git switch -c rescue <id></code></td><td class="yes">Safe. This is the safety net.</td></tr>
</table>
<h3>The safety net: reflog</h3>
<p>Git quietly keeps a diary of every place you have been, called the <strong>reflog</strong>. Even a "deleted" commit is usually still there for weeks.</p>
<div class="card">
<p class="quiet" style="margin:0 0 6px">You type:</p>
<p style="margin:0"><em>"I think I lost the commit where I fixed Q3. Look in the reflog, show me the candidates, and put the right one on a new branch called rescue. Don't touch main."</em></p>
</div>
<div class="stop">
<strong>Two things to say no to, every time, until you understand them:</strong><br>
<code>git reset --hard</code> — throws away uncommitted work permanently. The reflog cannot bring back something that was never committed.<br>
<code>git push --force</code> — overwrites what is on GitHub with your version. It can erase teammates' work.<br>
If Claude proposes either, answer: <em>"Why that one? Is there a safer way? What exactly would I lose?"</em>
</div>
<div class="good">
<strong>Cheap insurance:</strong> before any risky move, ask <em>"Make a backup branch of where we are right now."</em> It costs nothing and gives you a way back.
</div>
<h2 id="s11"><span class="n">11</span>Pushing</h2>
<p><strong>Push</strong> means "send my commits to GitHub". Until now everything has lived on your laptop. Push is the moment other people (or the internet) can see it.</p>
<p>The first time, you need a remote, the address of the repo on GitHub. For the private working repo:</p>
<div class="card">
<p class="quiet" style="margin:0 0 6px">You type:</p>
<p style="margin:0"><em>"Create a private GitHub repo called my-deck-reviews from this folder and push the main branch. Confirm it is private before you run it."</em></p>
</div>
<div class="anat"><b>gh repo create my-deck-reviews --private --source=. --push</b> <span class="hl"># create + push, privately</span>
<b>git push</b> <span class="hl"># later pushes</span></div>
<ul class="anat-m">
<li><code>gh repo create my-deck-reviews --private --source=. --push</code> creates the repo and pushes, privately</li>
<li><code>git push</code> is how you send later work</li>
</ul>
<p>Before you approve a push, check three things on that one line: <strong>where</strong> it is going, <strong>which branch</strong>, and that the word <code>--force</code> is <strong>not</strong> in it. On a first push, also check that <code>--private</code> is there.</p>
<p class="quiet">Pushing again is fine and routine. Each push just adds your newest commits.</p>
<h2 id="s12"><span class="n">12</span>Asking Claude to hold off</h2>
<p>The best control you have is one sentence. Claude does what you say; you only need to say it <em>early</em>.</p>
<div class="card">
<p class="quiet" style="margin:0 0 6px">Phrases worth keeping handy:</p>
<ul style="margin:0">
<li><em>"Commit, but do not push."</em></li>
<li><em>"Do not create a GitHub repo. I want to review first."</em></li>
<li><em>"Show me the full list of files that will be committed, and wait."</em></li>
<li><em>"Stage only these two files, not everything."</em></li>
<li><em>"Before you push, tell me the repo name, whether it's public, and the branch."</em></li>
<li><em>"Anything irreversible: ask me first."</em></li>
</ul>
</div>
<p>For the team, the full loop becomes: download the deck, Claude reviews it and writes the two notes, fixes go into a versioned copy, <strong>stop and read the diff</strong>, commit, <strong>stop and say push</strong>. Later, build the sanitised toolkit the same way: scan, commit, <strong>stop and read the file list</strong>, and only then ask for the public repo.</p>
<p>If you have a <code>CLAUDE.md</code> file in the folder (a note Claude reads at the start of every session), put the standing rules there once: <em>"Never overwrite originals. Never push without asking. Never commit anything in private/."</em></p>
<h2 id="s13"><span class="n">13</span>Words that stop mattering once you know them</h2>
<table>
<tr><td>repo</td><td>one project folder with its memory</td></tr>
<tr><td>commit</td><td>one saved snapshot, with a note</td></tr>
<tr><td>diff</td><td>what changed since the last snapshot</td></tr>
<tr><td>stage / add</td><td>choose which changes go in the next snapshot</td></tr>
<tr><td>branch</td><td>a separate line of work</td></tr>
<tr><td>merge</td><td>bring a branch's work back into main</td></tr>
<tr><td>pull request</td><td>"please look at this before it joins main"</td></tr>
<tr><td>remote</td><td>the copy of the repo that lives on GitHub</td></tr>
<tr><td>push</td><td>send commits to GitHub</td></tr>
<tr><td>worktree</td><td>a second folder on another branch, same repo</td></tr>
<tr><td>reflog</td><td>git's diary of everywhere you have been; the undo safety net</td></tr>
<tr><td>.gitignore</td><td>the list of things git must pretend not to see</td></tr>
<tr><td>gh</td><td>GitHub's command-line helper, used by Claude for PRs and repo creation</td></tr>
<tr><td>--hard / --force</td><td>the two flags to say no to</td></tr>
</table>
<div class="flag">
<strong>Not sure what Claude is about to do?</strong> Ask it. <em>"Explain this like I'm a teacher who has never opened a terminal."</em> It's patient, and the question is free.
</div>
<footer>
<strong>v1</strong> — first version: the twelve topics, with example prompts, and a fictional tutor-and-creators deck-review example running through them.<br>
Written for someone smart who isn't a programmer, as a companion to <a href="https://github.com/iteachc/github-without-panic">GitHub without the panic</a>, the prequel.<br>
Copy it, change it, send it on.
</footer>
</div>
</body>
</html>