Skip to content
jsworkbench.
Learning path
Advanced18 min

Handover and documentation

Understand the idea

A handoff is a commit whose message and file tell the next person where to start.

The idea

The README change is an ordinary snapshot. The message says why the next person should open it. Nothing about the is special except the words you chose.

What changes

git add README.md stages the note. The commit moves your branch. The other repository does not see it until you push or they fetch a pull request that contains it.

What the next person can read
PlaceSurvives the handoffWhere they look
README in the commitYesgit show
The commit messageYesgit log
A sentence you only said aloudNoNowhere in the repository

The command

Write the handoff in README.md. git add README.md, then git commit -m "hand off the fork notes". git show HEAD prints the file.

The mistake

Check your graph

The new commit is on your branch, and git show prints the handoff note.

Your repository

Commit a README note that says what the branch is for and what to read next.

  1. Step 1

    Write the handoff

    In the editor, set README.md to: Handoff: class-notes explains the fork. Next person should read the pull request before merging.

  2. Step 2

    Stage the note

    This is an ordinary file commit.

  3. Step 3

    Commit the handoff

    The message says why the next person should care.

  4. Step 4

    Read it back

    git show is the file the next person will open.

The editor edits the working tree. Start a repository and the files appear here.

Follow the steps. Each command step can be placed in the terminal. Edit files in the editor, then stage them.
Supported command reference
  • init
  • add <path> | add .
  • commit -m "message" | commit --amend -m "message"
  • status
  • diff | diff --staged
  • log | log --oneline | log --graph | log --oneline --graph
  • show [ref]
  • branch | branch <name> | branch -d <name>
  • checkout <ref> | checkout -b <name> | switch <name> | switch -c <name>
  • merge <branch>
  • rebase <branch> | rebase -i <branch> | rebase --edit-todo <pick|drop|reword> <hash> [message] | rebase --continue | rebase --abort
  • cherry-pick <ref>
  • reset --soft <ref> | reset --mixed <ref> | reset --hard <ref>
  • revert <ref>
  • stash | stash list | stash pop | stash apply
  • restore <path> | restore --staged <path>
  • remote | remote add <name> <repo-slug>
  • clone <repo-slug> | git clone <repo-slug> | git fork <repo-slug>
  • fetch [remote] | pull [remote] [branch] | push [remote] [branch] | push --force [remote] [branch]
  • blame <path>
  • reflog
  • tag | tag <name> [ref] | tag -d <name>
  • bisect start | bisect good [ref] | bisect bad [ref] | bisect reset
  • config <key> <value> | config --list
  • write <path> <text> (workbench: edit the working tree)
  • issue new "title" | pr new <source> <target> "title" | review "comment" | review --request-changes "comment"

Commit graph

No commits yet. git init creates the first one.

Quiz

A quick check for understanding. Retry as often as you like; your learning path stays open.

01What makes the handoff real?
02What should the message say?

Ready to call this one understood?

Mark this lesson complete to earn 200 XP. You can always revisit it.

Sign in to save progress