GitHub basics
Validate outputs and schemas
Github hosts git repositories and adds pull requests, reviews, checks, and permissions around shared branches.
Before you start
Why this matters
Before running anything, predict one observable result from the case: a branch named improve-evaluation contains one reviewed change that must pass tests before it reaches main. Write the prediction beside the command or code line that should cause it. This makes the session an experiment rather than a transcription exercise.
1Learn the idea
Read
Evaluate the chapter step
Validation asks whether the artifact is correct, not merely whether it completed. Confirm the Files changed tab contains only the intended files, the base branch is correct, test instructions work from a fresh checkout, and every required check reports success for the latest commit. Include a deliberately wrong case so the check proves it can fail. A test that never observes a bad result may be checking the wrong thing.
Confirm the Files changed tab contains only the intended files, the base branch is correct, test instructions work from a fresh checkout, and every required check reports success for the latest commit.
Read
Run the working example
git switch -c improve-evaluation
python -m pytest
git add train.py tests/test_train.py
git commit -m "Test held-out evaluation"
git push -u origin improve-evaluation
git status -sb
Expected evidence:
2 passed in 0.08s
branch 'improve-evaluation' set up to track 'origin/improve-evaluation'.
Read
improve-evaluation...origin/improve-evaluation
The output may include version-specific details such as hashes, paths, fitted thresholds, or final decimal places. Compare the structural facts described here rather than copying placeholders. If the structure differs, stop and inspect the earliest unexpected line.
Read
Read it line by line
git switch -ccreates and checks out a local feature branch.pytestsupplies evidence before publication; a successful push is not proof that code works.git push -u origin ...sends commits and records the upstream branch.- the pull request is created on GitHub after the branch exists; pushing does not merge it.
These lines form one chain: local commits on improve-evaluation plus the repository's pull-request rules becomes a remote feature branch and a reviewable proposal into main. Change only one input first. When several values change together, you cannot tell which change caused the new behavior.
Read
Common errors and fixes
- First failure:
remote origin already existsmeans inspectgit remote -vinstead of adding a duplicate. Re-run the smallest command that proves the repair. - Second failure: a rejected non-fast-forward push usually means the remote branch moved; fetch and reconcile rather than force-pushing shared history. Preserve the failing input as a test when it represents a realistic mistake.
- Misleading success: a red required check must be opened and read; rerunning without a code or infrastructure reason hides the actual failure. A clean-looking final line cannot cancel contradictory intermediate evidence.
When debugging, copy the exact error text and inspect names, paths, shapes, types, and versions. Explain the cause in one sentence before changing code. That discipline prevents a guessed repair from creating a second defect.
Read
Evidence for this stage
Read every command or statement before running it. The examples deliberately expose intermediate state so a surprising result has somewhere concrete to point.
For the current evaluate step, save the smallest useful evidence: the relevant command, its output, and the input that produced it. Do not use a screenshot as the only record when text can be copied and searched. Keep generated artifacts separate from source inputs so rerunning the example does not destroy the evidence it is meant to evaluate.
On this page, the practical job is to compare the result with an independent expectation. The running case is a branch named improve-evaluation contains one reviewed change that must pass tests before it reaches main.
Read
Reflect on the result
Return to your opening prediction. Mark it correct or rewrite it with the condition you missed. Then explain the difference between a successful execution and a trustworthy result for this specific example.
Continue learning · glossary & guides
- Which line or command establishes the current step's most important fact?
- What output would reveal that
remote origin already existsmeans inspectgit remote -vinstead of adding a duplicate? - Can a new user reproduce a narrow pull request with a useful summary, reproducible test steps, and a green required check from the stated setup?