Git-command chain hygiene (#33,#34,#35) (#63)
Co-authored-by: claude <claude@jpaul.io> Co-committed-by: claude <claude@jpaul.io>
This commit was merged in pull request #63.
This commit is contained in:
@@ -11,6 +11,10 @@
|
||||
- **Module 2 — Version Control as a Safety Net.** You can `init`, `commit`, read `git diff`/`git
|
||||
log`/`git status`, and `git restore` an unwanted change. Branches build directly on commits: a
|
||||
branch is just a label on the commit history you already understand.
|
||||
- **Module 3 — Version Control for Words.** You first met `git branch`, `git switch -c`, `git merge`,
|
||||
and `git branch -d` there — on a markdown doc, where a mistake costs nothing and the merge always
|
||||
fast-forwarded. This module takes those same verbs to *code*, where branches actually diverge and
|
||||
merges can conflict.
|
||||
- **Module 4 — Getting the AI Out of the Browser.** The AI now edits your real files directly from
|
||||
your editor. That's exactly the capability that makes branches matter — you're about to let it edit
|
||||
files *fast and confidently*, and you want a wall around the blast radius.
|
||||
@@ -43,6 +47,10 @@ By the end of this module you can:
|
||||
|
||||
### What a branch actually is
|
||||
|
||||
You already drove this loop once — `git switch -c`, `git merge`, `git branch -d` on a doc in Module 3,
|
||||
where the merge always fast-forwarded because nothing else had moved. Here the same verbs meet code
|
||||
that diverges and conflicts, so it's worth pinning down what a branch really is before we lean on it.
|
||||
|
||||
Strip the mystique and a branch is **a named, movable pointer to a commit.** That's the whole
|
||||
definition. Your commit history is a chain of snapshots (Module 2); a branch is a sticky label that
|
||||
points at one of them and *moves forward* every time you commit on it.
|
||||
@@ -65,10 +73,11 @@ git branch -d experiment # delete a branch you've already merged
|
||||
git branch -D experiment # FORCE-delete a branch, merged or not (the "throw it away" button)
|
||||
```
|
||||
|
||||
> **Naming note.** `git switch` (create/move between branches) and `git restore` (the Module 2 undo)
|
||||
> were split out of the older, overloaded `git checkout` command. You'll still see `git checkout -b
|
||||
> experiment` everywhere online — it does the same thing as `git switch -c experiment`. Both work;
|
||||
> this module uses `switch`/`restore` because they say what they mean.
|
||||
> **Naming note** (you saw the short version in Module 3). `git switch` (create/move between branches)
|
||||
> and `git restore` (the Module 2 undo) were split out of the older, overloaded `git checkout` command.
|
||||
> You'll still see `git checkout -b experiment` everywhere online — it does the same thing as
|
||||
> `git switch -c experiment`. Both work; this module uses `switch`/`restore` because they say what they
|
||||
> mean.
|
||||
|
||||
### The reframe: a branch is a sandbox you can blow away
|
||||
|
||||
|
||||
Reference in New Issue
Block a user