Skip to content
jsworkbench.
Learning path
Advanced18 min

Code review

Understand the idea

Review comments live on the pull request. Requesting changes means the diff is not ready to merge.

The idea

git review "Please rename the helper" appends that comment to the latest and marks the request as changes requested. The comment is not a commit, and it is not a chat line that disappears when you clear the terminal. The author updates the branch with new commits. The reviewer looks at the new diff.

What changes

The request's review list grows by one entry: author, body, and a request for changes. The tip does not move. A later commit on the source branch updates the diff the request is about. Merging still waits until someone decides the conversation is done.

Where a comment can live
PlaceSurvives reloadChanges the files
Terminal scrollbackNoNo
Review on the pull requestYesNo
A new commitYesYes

The command

Open a pull request first. Then run git review "Please rename the helper so it says what it checks". The request status becomes changes requested. Push more commits on the source branch if you are the author. Those commits are the response. The comment stays on the request.

The mistake

Check your graph

HEAD is where it was. The new fact is on the pull request: a stored comment, and a status that says the diff is not ready to merge.

Your repository

Leave a review comment on your pull request and read it back as part of the request, not as a chat log.

  1. Step 1

    Leave the review on the request

    Open the pull request in the previous lesson first. This comment is stored on that request, not in the terminal history.

  2. Step 2

    Answer with a commit

    In the editor, change login.txt to: Reject an empty login before submit

  3. Step 3

    Stage the response

    The review comment stays on the pull request. This command stages the new text.

  4. Step 4

    Commit the response

    The diff moves. The comment is still on the request.

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.

01Where does a review comment live?
02What does requesting changes mean?

Ready to call this one understood?

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

Sign in to save progress
Next lesson