Skip to content

Pedagogy: refresh tutorial/10.git.ipynb (drop 2.23 hedges; add restore, SSH, default-branch=main, --rebase-merges) #418

@kwlee2025cpp

Description

@kwlee2025cpp

Why

tutorial/10.git.ipynb was authored when git switch/git restore
were experimental (git 2.23). 6+ years later they are stable, default
branch is main not master, and a few topic gaps have opened up
(SSH-key auth, --rebase-merges). The current intro also jumps
straight into "what is version control" without motivating the
beginner-relevant question — how do I keep my work and not lose it?
that the tutorial actually answers.

Related:

Concrete edits

  • New beginner-framing intro paragraph before the existing
    version-control definition cell. Bilingual (English + Korean) to
    match the rest of the notebook. Frames the three questions git
    answers (save / recover / share).
  • Drop (git >= 2.23) qualifier ×4. Four headings still hedge
    git switch / git switch -c. Drop the qualifier; flip ordering so
    switch / restore are primary and checkout <branch> is shown as
    legacy.
  • Add git restore subsection alongside git switch:
    • git restore <file> to discard an unstaged edit
    • git restore --staged <file> to unstage
  • Default branch name = main. One-liner near the existing
    git config discussion; since git 2.28 (mid-2020), git init -b main
    and init.defaultBranch=main are the convention.
  • Add SSH key authentication section alongside the existing
    PAT section:
    • ssh-keygen -t ed25519 -C "you@example.com"
    • add public key to GitHub → Settings → SSH keys
    • verify with ssh -T git@github.com
    • switch existing remotes via
      git remote set-url origin git@github.com:user/repo.git
    • brief contrast: SSH = once-per-machine; PAT = HTTPS bearer
      (still needed for CI / locked-down environments). Both remain
      valid.
  • Add git rebase -i --rebase-merges note. Default interactive
    rebase silently drops merge commits; --rebase-merges preserves them
    — relevant for repos with upstream-merge / template-chain commits.

No-touch list (stable, already correct)

clone, add, commit, status, log, diff, remote, push,
pull, fetch, config, branch, basic rebase, fork→sync workflow.

Out of scope (future expansion candidates)

Open design calls (resolve during implementation)

  • SSH section depth: quick-reference (5 commands, no troubleshooting)
    or full walkthrough including ssh-agent setup and key-types
    rationale (ed25519 vs RSA)?
  • Order on the page: PAT-first (existing flow) or SSH-first?

Metadata

Metadata

Assignees

No one assigned

    Labels

    pedagogyNotebook content / teaching changes

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions