Public course previewThis is not your assigned passport. No identity, answers, or completion progress are stored here.How to start your passport
Guided lesson
02 / 02About 45 minuteschanges practice files

Complete A Manual Pull Request Loop

Prepare one small change your colleague can understand, and explain exactly which version reaches GitHub for review. Keep the shared main branch unchanged.

Where you will workOn the laptop or desktop in front of you
  1. 1Understand
  2. 2Try it yourself
  3. 3Check and submit

What exactly will your colleague receive?#

You will add a reminder to a fictional project note, then open a draft PR that a colleague could review. You do not need to contact anyone. Follow the change through three places:

  • Your file: the working tree is the folder you edit. Staging selects the saved content for the next commit.
  • Your history: a commit records that selection on your computer. Your practice branch keeps it separate from main.
  • Your review page: pushing sends your commits to GitHub. A pull request (PR) compares your branch with main for someone to review.

Leave the PR in draft: it is not ready to merge. The Conventional Commit format is explained in step 7.

What will this commit contain?#

Imagine editing meeting-note.md. You add Monday, save, and stage the file. Then you add Room 204 and save again, without staging again.

If you commit now, will it include Monday, Room 204, or both? Why? Think it through before opening the explanation. No answer to submit.

See the three versions
Where the version is What it contains
Last commit Original note
Staging area: selected for the next commit Original note + Monday
Working tree: saved in your editor Original note + Monday + Room 204

The commit includes Monday, but not Room 204. Staging captures the saved content at that moment; saving again does not update the selection. To include the room, you would stage the newer version and review it.

You will inspect two diffs: your edit, then the selection for the commit. Do not create meeting-note.md; it is only an example.

Optional: another explanation of staging. Read just that page, then return here; you do not need its Next links or commands.

Select the named practice file, not every file with git add .. Keep the PR in draft; do not merge it. The Passport handles its background submission separately.

Start the practice

Practice

Try it in your practice folder

Follow in order

Steps

Work in the prepared practice folder, using the same terminal throughout. Leave the PR open in draft.

Optional: using the terminal

A command is a line of text that tells a computer to do one task. You paste it into a terminal, the text application used for commands. A shell is the part inside that application that reads the command. PowerShell, zsh, and Bash are shells. Open only the application named for your computer below; it starts its configured shell. Follow the shell named below. You do not need to install a separate Bash or zsh application.

Your computer or local means the laptop or desktop in front of you. Remote means another computer reached through the network. A command affects whichever computer the step names, so check that label before pasting.

  • Windows: press the Windows key, type PowerShell, and open the result named PowerShell. Do not use Command Prompt, Git Bash, or WSL for a block labelled PowerShell.
  • macOS: press Command+Space, type Terminal, and press Return. Terminal normally starts the zsh shell. If it uses another shell, run zsh for this session.
  • Linux: open the app named Terminal from the applications menu. It normally starts the Bash shell. If it uses another shell, run bash for this session.

The prompt is the text beside the blinking cursor. For each card, check the named computer, choose Copy, paste only the command after the prompt, press Enter once, and wait for the prompt to return.

If you have never done this before, first run the harmless terminal-ready practice on the start page. It lets you practise copying, pasting, pressing Enter, and reading output before a setup command.

Practise one harmless command firstHow to open a terminal and run a command
  1. 01

    Open the practice folder

    On your computer

    Click Prepare practice folder. Run its enter-folder command in your terminal, then keep that terminal in this folder.

    Practice folder

    The launcher creates or reuses the exercise folder for this course. It does not change another folder.

    Open this lesson from your local Passport to prepare the folder.

    Look forYour terminal is in the exact folder shown by preparation, on its practice branch.

    Explanation and help
    What this means
    The prepared copy gives you a practice branch without changing another project. Read its task before choosing any file to edit.
    Safe recovery
    Retry the preparation or run gh passport doctor. Do not create another clone.
  2. 02

    Inspect before editing

    On your computer

    Run these commands to read the task and note. Stop if the branch differs from the prepared practice branch or unexpected edits appear.

    RunPowerShell on Windows
    git status --short --branch
    Get-Content -LiteralPath workspace/manual_task/README.md
    Get-Content -LiteralPath workspace/manual_task/project-note.md
    RunTerminal on macOS (zsh)
    git status --short --branch
    sed -n '1,160p' workspace/manual_task/README.md
    sed -n '1,160p' workspace/manual_task/project-note.md
    RunTerminal on Linux (Bash)
    git status --short --branch
    sed -n '1,160p' workspace/manual_task/README.md
    sed -n '1,160p' workspace/manual_task/project-note.md

    Look forThe branch starts with practice/. No modified file is listed. The task names project-note.md as the file to edit.

    Explanation and help
    What this means
    You know the starting version and the scope of the change. The task README is an instruction, not a file to modify.
    Safe recovery
    Stop if the branch is different or changes already exist. Inspect them before editing; do not reset the repository.
  3. 03

    Open the same folder in your editor

    On your computer

    In VS Code, choose File > Open Folder and select the exact practice-folder path shown by the Passport. Open workspace/manual_task/project-note.md. Edit it yourself, without an AI agent.

    Look forYour editor shows project-note.md inside the prepared practice folder.

    Explanation and help
    What this means
    Your editor and terminal point to the same practice folder, so the file you save is the file Git will inspect.
    Safe recovery
    Compare the editor folder with the preparation path. If needed, install VS Code using the download link. Do not edit the handbook or a research repository.
  4. 04

    Write a reminder your colleague can use

    On your computer

    In workspace/manual_task/project-note.md, add a ## Verification heading and one short sentence in your own words about reviewing the staged diff before publishing. Include the terms staged diff and review. Save only this file. Put the text in your editor, not the terminal.

    Show a model if you need one
    Put in fileMarkdown file
    ## Verification
    
    The staged diff must be reviewed before publishing.

    Look forThe saved note has your heading and reminder. No other file has changed.

    Explanation and help
    What this means
    Saving updates your working file. The next diff lets you decide whether these are the lines you want your colleague to receive.
    Safe recovery
    Correct only the mistaken lines in your editor. Do not reset or delete the practice folder.
  5. 05

    Read your change as a reviewer

    On your computer

    Read every added (+) and removed (-) line. Is this the change you intended? Fix anything unexpected in the editor before staging.

    RunPowerShell on Windows
    git status --short
    git diff -- workspace/manual_task/project-note.md
    RunTerminal on macOS (zsh)
    git status --short
    git diff -- workspace/manual_task/project-note.md
    RunTerminal on Linux (Bash)
    git status --short
    git diff -- workspace/manual_task/project-note.md

    Look forOnly workspace/manual_task/project-note.md is modified. Its diff shows your heading and reminder, without unrelated changes or private information.

    Explanation and help
    What this means
    A diff compares two versions. Here, git diff compares your saved file with the staged version. Next, select only the named file.
    Safe recovery
    Correct unexpected content before staging. If another file changed, understand why before continuing.
  6. 06

    What will this commit contain?

    On your computer

    Run the block to stage the note, then read the staged diff. Confirm every line before committing. If you edit again, stage and review the newer version.

    RunPowerShell on Windows
    git add -- workspace/manual_task/project-note.md
    git diff --cached --check
    git diff --cached
    RunTerminal on macOS (zsh)
    git add -- workspace/manual_task/project-note.md
    git diff --cached --check
    git diff --cached
    RunTerminal on Linux (Bash)
    git add -- workspace/manual_task/project-note.md
    git diff --cached --check
    git diff --cached

    Look forThe staged diff contains only the intended note change. The whitespace check prints nothing when it passes.

    Explanation and help
    What this means
    git add selects the current saved content. git diff --cached compares that selection with the last commit; --check checks whitespace. The selection is what your next commit will record.
    Safe recovery
    For an unintended staged path, use git restore --staged on that path to keep the edit but remove it from the selection. Correct and review again.
  7. 07

    Record the version you chose

    On your computer

    Will your colleague see this new commit on GitHub? Think about that, then run the command.

    RunPowerShell on Windows
    git commit -m "docs(practice): explain staged diff review"
    RunTerminal on macOS (zsh)
    git commit -m "docs(practice): explain staged diff review"
    RunTerminal on Linux (Bash)
    git commit -m "docs(practice): explain staged diff review"

    Look forGit prints a new commit with the subject docs(practice): explain staged diff review.

    Explanation and help
    What this means
    The commit is recorded on your computer. It reaches GitHub when you push. The Conventional Commit format is type(scope): summary: docs means documentation, practice names the area, and the summary describes the change.
    Safe recovery
    Read the first Git error and ask for help if needed. Do not force the operation or skip hooks.
  8. 08

    Push and open a draft pull request

    On your computer

    Which command shares your commit, and which asks for review? Run the prepared git push command, then its gh pr create command, one at a time. Keep --draft. Leave the PR open in draft; do not merge it.

    Look forOne open draft PR proposes your practice branch to main. Opening it has not merged your change into main.

    Explanation and help
    What this means
    Pushing sends your commits to your GitHub branch. A PR compares that branch with main for review. Opening it does not change main. If you later correct the note, review, stage and commit the correction on this same branch, then push again. The existing PR updates; you do not need another PR.
    Safe recovery
    If a PR already exists, inspect it with gh pr status. Do not create a second one or force-push.
  9. 09

    Review what GitHub received

    On your computer

    Run both commands to open your PR; the local Passport fills in your fork and branch. Do not run gh repo set-default. In Files changed, check that the reminder makes sense and the diff matches your reviewed edit.

    RunPowerShell on Windows
    gh pr status --repo {{fork_repository}}
    gh pr view {{practice_branch}} --repo {{fork_repository}} --web
    RunTerminal on macOS (zsh)
    gh pr status --repo {{fork_repository}}
    gh pr view {{practice_branch}} --repo {{fork_repository}} --web
    RunTerminal on Linux (Bash)
    gh pr status --repo {{fork_repository}}
    gh pr view {{practice_branch}} --repo {{fork_repository}} --web

    Look forYou are the author; your practice branch targets main. Only project-note.md changed, with your reviewed reminder and commit subject. Leave the PR open in draft; do not merge it.

    Explanation and help
    What this means
    Compare your saved note, recorded commit and PR diff: they should show the same reminder. You can now use Check my work, then Submit lesson.
    Safe recovery
    If no PR appears, return to Push and open a draft pull request. Otherwise correct the same branch and push again. Do not configure a default repository, create a second PR, merge, or delete the existing PR.

Finish the lesson

Check and submit

Answer these 3 questions, then confirm the work you checked.

Every answer must be correct. Completion appears after the automatic GitHub check passes.

01You stage a note, then save another correction without staging again. You commit. Which version is recorded?Safety-critical
02Your draft PR is open. You make another commit on the same practice branch, but have not pushed. What does its Files changed page show?Safety-critical
03Someone reviewing your draft PR spots an unclear sentence. You agree and save a correction in the same practice folder. How do you update that PR?Safety-critical
Before submitting

The launcher will copy only this lesson's declared fictional practice files into the public submission. Review those files as well as these answers.

Open my real passport first

You can check sample answers here. Open your local Passport to check your practice files and submit the lesson.

Preview onlyYou can try the questions here. This page does not store or submit your answers.
Need help?Open recovery steps and AI-review guidance

If Blocked#

Do not use git reset --hard, broad deletion, or force push as a first repair. Preserve git status, the current branch, and the diff, then use the first safe PR lab recovery section or ask for help through the non-secret dashboard issue form.

Useful references:

Understand Before Accepting AI Output#

This mission is deliberately manual. An agent may explain a Git concept but must not perform the change, invent test output, or choose files to stage.