SovranCode
HomeCourses Git & GitHub Git Project: Reviewed Pull Request
This device
Course contentsGit Project: Reviewed Pull Request · 41 topics

1. Git Fundamentals

Git IntroductionGit Version ControlGit vs GitHubGit InstallationGit Working TreeGit RepositoryGit CommitGit .gitignoreGit Project: Learning Journal

2. Git History

Git LogGit DiffGit ResetGit RevertGit StashGit Project: Messy Repository

3. Branches & History

Git BranchGit MergeGit Merge ConflictsGit RebaseGit Cherry-PickGit TagsGit Project: Feature Branch

4. Remotes and GitHub

Git RemoteGitHub AuthenticationGitHub RepositoryGitHub ForkGitHub IssuesGitHub PagesGit Project: Two Clone Sync

5. GitHub Collaboration

GitHub Pull RequestsGitHub Code ReviewGit Branching WorkflowGitHub Branch ProtectionGitHub CollaborationGitHub ContributingGit Project: Reviewed Pull Request

6. Automation and Professional Git

GitHub ActionsGit InternalsGit RecoveryGitHub SecurityGit Project: Team Repository CIProject
Learn Git & GitHub40 complete · 1 planned

1. Git Fundamentals

Git IntroductionGit Version ControlGit vs GitHubGit InstallationGit Working TreeGit RepositoryGit CommitGit .gitignoreGit Project: Learning Journal

2. Git History

Git LogGit DiffGit ResetGit RevertGit StashGit Project: Messy Repository

3. Branches & History

Git BranchGit MergeGit Merge ConflictsGit RebaseGit Cherry-PickGit TagsGit Project: Feature Branch

4. Remotes and GitHub

Git RemoteGitHub AuthenticationGitHub RepositoryGitHub ForkGitHub IssuesGitHub PagesGit Project: Two Clone Sync

5. GitHub Collaboration

GitHub Pull RequestsGitHub Code ReviewGit Branching WorkflowGitHub Branch ProtectionGitHub CollaborationGitHub ContributingGit Project: Reviewed Pull Request

6. Automation and Professional Git

GitHub ActionsGit InternalsGit RecoveryGitHub SecurityGit Project: Team Repository CIProject
PREVIOUS LESSONGitHub Contributing
NEXT LESSONGitHub Actions
5. GitHub Collaboration 140 min

Git Project: Reviewed Pull Request

Take a change through issue, branch, pull request, review comments, and merge so the GitHub conversation matches the Git graph.

UNIT 05 · COLLABORATION140 MINGITHUB REVIEW YOU OWN

Take one defect through a GitHub issue, a short-lived feature branch, a pull request, requested changes, a follow-up push, and a merge whose Git graph you can name.

MISSION PARAMETERS
Working copiesExactly 1
GitHub issueExactly 1
Pull requestExactly 1
Force-pushForbidden
THE SETUP

One owned repository

You are author and reviewer on a disposable GitHub repository. The second folder from Two Clone Sync is not required. A fork is not required.

THE OUTCOME

Conversation matches graph

Issue #1 is closed by the merged pull request. Review comments still explain the Pages-URL defect. Local main equals origin/main, and you can name the merge strategy that produced that graph.

Project brief

Unit 5 taught the pieces separately: GitHub Issues, GitHub Pull Requests, GitHub Code Review, a branching model, protection, templates, and contributing habits. This project runs them in order on a repository you own so the GitHub conversation and the Git graph are the same story.

IssueDescribe a clone-command defect a stranger can reproduce.
ProposePush a feature branch and open a pull request that links Closes #1.
ReviewRequest changes on a planted Pages URL, then answer with git push.
ProveMerge with a named strategy, update local main, and show the issue closed.
PROJECT WORKSPACE

Evidence tracker

Mark a gate complete only after the named command or review proves it. Progress is saved in this browser.

0%0/7 verified
  1. Open gate
  2. Open gate
  3. Open gate
  4. Open gate
  5. Open gate
  6. Open gate
  7. Open gate
Next evidence gate: Hosted clone card

Safety boundary

Disposable repository only

Create a new parent folder named reviewed-pull-request. Never run these commands inside SovranCode, your home directory, or valuable work.

A GitHub remote you own

Create sovrancode-reviewed-pr under your account. Do not open this pull request on a popular public project. Delete the practice repository when the evidence is recorded.

No force-push

Review starts after the first feature commit. git push --force and --force-with-lease on that branch fail this project.

No second clone, no fork

Two Clone Sync already proved matching tips on main. This project moves main through a reviewed pull request. Do not add upstream or a desk folder.

Confirm the root before every push

Run git rev-parse --show-toplevel. It must end in clone-card. Stop if it does not. Do not paste tokens, passwords, or private URLs into files, issues, or review comments.

Repository contract

One folder, one origin

Initialize history in clone-card. Origin is the GitHub repository you create. After milestone 1, do not commit the Clone heading on main.

README.md

The only product file. First commit: status that the Clone heading is missing. Feature commits add, then correct, that heading.

Empty GitHub create

No GitHub-generated README, license, or gitignore. Those files would be a different first commit than yours.

GitHub Flow

Short-lived feature/clone-url, reviewed merge, delete the branch. You do not need a develop branch. Actions stay out of this project.

reviewed-pull-request/
└── clone-card/            ← one working copy of a GitHub repository YOU own

GitHub repository (origin): sovrancode-reviewed-pr
This is not a second clone of Two Clone Sync. Stay on a feature branch after the first README.

Git records the branch and the commits. GitHub stores the issue, the pull request, and the review comments. git show will not print the request-changes body. Both layers are required evidence.

Required conversation and graphs

MERGE STRATEGY

Two-parent merge

*   Merge pull request #1 (HEAD -> main, origin/main)
|\
| * Use the GitHub Git URL in the Clone section
| * Document how to clone this repository
|/
* Initialize clone card
SQUASH STRATEGY

One new commit on main

* Document how to clone this repository (HEAD -> main, origin/main)
* Initialize clone card

Pick one GitHub merge flag: gh pr merge 1 --merge, gh pr merge 1 --squash, or gh pr merge 1 --rebase. Draw the graph you expect before you merge. Rebase-merge is linear like squash but keeps the feature commit messages; name that if you choose it.

CONVERSATION GATE

Issue, review, close

Issue #1 is complete. The pull request requested changes, received a follow-up commit, then merged. gh issue view 1 shows closed.

gh pr view 1 --comments
GRAPH GATE

Named strategy

Local main matches origin/main. The log matches the merge flag you chose. The feature branch is gone from the remote.

git log --oneline --decorate --graph -n 12
SAFETY GATE

No force, no main commits

The Clone heading never arrived by git push origin main of the feature. Review was answered with an ordinary push.

git ls-remote origin refs/heads/main

Milestone 1 · Host the clone card

Create the parent folder, initialize only clone-card, commit the README contract, then publish an empty GitHub repository you own. Record the first commit ID. There is no Clone heading yet.

mkdir -p reviewed-pull-request/clone-card
cd reviewed-pull-request/clone-card
git init -b main
git status

# Write README.md from the contract below, then:
git add README.md
git diff --cached
git commit -m "Initialize clone card"
git status
git rev-parse HEAD

git rev-parse --show-toplevel
gh auth status
gh repo create sovrancode-reviewed-pr --public --source=. --remote=origin --push

git remote -v
git branch -vv
git ls-remote origin
git rev-parse HEAD
README CONTRACT

Status only, no Clone command yet

# Clone card

A tiny README that must tell a stranger how to clone this GitHub repository.

## Status

The Clone heading is missing. File an issue, then add it on a feature branch.
NOT THIS COMMIT

Do not add Clone on main

The Clone heading belongs on feature/clone-url. If you add it here, reset only if this commit is still unpublished to people you care about—or start a new disposable repo.

Replace OWNER later with your GitHub username. Omit any gh repo create flag that adds a README. If you used the website instead, add origin yourself, then run git push -u origin main. Proof: git ls-remote origin lists the same object as git rev-parse HEAD.

Milestone 2 · File the issue

Stay on main. Open one GitHub issue before you branch. Use the headings GitHub Issues required. If this repository already has a bug template from Collaboration, use it and fill every heading.

gh issue create --title "Clone command is missing or is a Pages URL" --body "$(cat <<'EOF'
## Problem
The README has no Clone heading a stranger can copy, or the command is a GitHub Pages URL.

## Expected result
README.md has a Clone heading whose command is this repository's GitHub Git URL (HTTPS or SSH). A stranger who pastes it can run git clone.

## Reproduction
1. Open README.md on main.
2. Confirm there is no working git clone command, or that the command uses a .github.io host.
3. Note that a Pages URL is a static site, not a Git remote.
EOF
)"
gh issue list
gh issue view 1
## Problem
The README has no Clone heading a stranger can copy, or the command is a GitHub Pages URL.

## Expected result
README.md has a Clone heading whose command is this repository's GitHub Git URL (HTTPS or SSH). A stranger who pastes it can run git clone.

## Reproduction
1. Open README.md on main.
2. Confirm there is no working git clone command, or that the command uses a .github.io host.
3. Note that a Pages URL is a static site, not a Git remote.

Proof: issue #1 exists on this repository, not on a project you do not maintain. Do not start coding until the issue is filed. The pull request will close this number; if you file two issues, Closes #1 must still name the clone defect.

Milestone 3 · Branch with a planted defect

Create feature/clone-url from current main. Add a Clone heading that uses a GitHub Pages URL on purpose. That defect is the review target. Commit and push the branch. Do not merge yet.

git switch main
git pull origin main
git switch -c feature/clone-url

# Append the planted Clone heading to README.md, then:
git add README.md
git diff --cached
git commit -m "Document how to clone this repository"
git push -u origin feature/clone-url
git branch -vv
git diff main...HEAD --stat
## Clone

git clone https://OWNER.github.io/sovrancode-reviewed-pr/

Replace OWNER with your username so the Pages host looks plausible. The command must still be wrong: .github.io is a static site host, not a Git remote. git diff main...HEAD --stat must list only README.md.

Milestone 4 · Open the pull request

Open a GitHub pull request from feature/clone-url into main. This is GitHub, not git pull. Fill summary, verify steps, and Closes #1. If a pull request template exists, use it; do not leave Closes # without a number.

gh pr create --base main --title "Document how to clone this repository" --body "$(cat <<'EOF'
## Summary
Adds a Clone heading so a stranger can copy the GitHub Git URL.

## Linked issue
Closes #1

## How to verify
1. Open README.md on this branch.
2. Confirm the clone command uses the GitHub Git URL, not a Pages URL.
3. Confirm no other files changed.
EOF
)"
gh pr list
gh pr view 1
gh pr diff 1
## Summary
Adds a Clone heading so a stranger can copy the GitHub Git URL.

## Linked issue
Closes #1

## How to verify
1. Open README.md on this branch.
2. Confirm the clone command uses the GitHub Git URL, not a Pages URL.
3. Confirm no other files changed.

Proof: gh pr view 1 shows the issue link and the branch name. gh pr diff 1 still contains the Pages URL. If GitHub says the pull request can be merged, that is not review. You have only proposed.

Milestone 5 · Request changes

You are the reviewer now. On GitHub, Files changed, leave a line comment on the clone command. Then submit an overall verdict. Review comments are GitHub conversation data, not Git objects.

gh pr diff 1
gh pr view 1 --comments

gh pr review 1 --request-changes --body "$(cat <<'EOF'
The Clone section still uses a Pages URL.

That address is a static site host, not a Git remote. A stranger who copies it cannot git clone this repository.

Please change the command to the GitHub Git URL, then push the fix to this same branch.
EOF
)"

Proof: gh pr view 1 --comments includes the request. Approving now fails the project. Do not merge. Do not open a second pull request.

Milestone 6 · Answer with an ordinary push

Stay on feature/clone-url. Replace the Pages URL with the GitHub Git URL. Commit and git push. Do not force-push. Reviewers already have the first commit.

# Stay on feature/clone-url. Do not switch to main.
# Edit README.md so git clone uses the GitHub Git URL, then:
git add README.md
git diff --cached
git commit -m "Use the GitHub Git URL in the Clone section"
git push
gh pr view 1 --comments
gh pr diff 1

# These rewrite history reviewers already read. Do not run them:
# git push --force
# git push --force-with-lease
## Clone

git clone https://github.com/OWNER/sovrancode-reviewed-pr.git

HTTPS or SSH is fine if it is this repository's Git remote. Proof: gh pr diff 1 no longer contains .github.io, and the pull request still has two feature commits (unless you already chose squash-only locally—which you must not; leave both commits on the branch).

Milestone 7 · Merge and prove the graph

Approve, then merge with one flag you can justify. Update local main from origin. Delete the feature branch locally and on the remote. Confirm the issue closed.

gh pr review 1 --approve --body "Clone command now uses the GitHub Git URL. Verified on this branch."

# Pick ONE. Draw the graph before you run it.
gh pr merge 1 --merge
# gh pr merge 1 --squash
# gh pr merge 1 --rebase

git fetch origin
git switch main
git pull origin main
git log --oneline --decorate --graph -n 12
git rev-parse HEAD
git ls-remote origin refs/heads/main

git branch -d feature/clone-url
git push origin --delete feature/clone-url
git branch -vv

gh pr view 1
gh issue view 1

If GitHub Branch Protection already refuses git push origin main, that is expected: the pull request was the legal path. Do not turn on two-reviewer lockout on a solo repo. Required Actions checks are GitHub Actions.

Proof: git rev-parse HEAD equals the object from git ls-remote origin refs/heads/main. gh issue view 1 is closed. The log matches the flag you chose. Status is clean.

git rev-parse --show-toplevel
git remote -v
git status
git fetch origin
git switch main
git pull origin main
git log --oneline --decorate --graph -n 12
git branch -vv
git rev-parse HEAD
git ls-remote origin refs/heads/main
gh pr view 1
gh pr view 1 --comments
gh issue view 1

Required failure drills

Requested changes before approve

Milestone 5 is the drill. An approve-and-merge with no request-changes body fails the review contract.

Ordinary push, no force

Milestone 6 is the drill. Save git log --oneline main..feature/clone-url showing two commits after the fix.

Wrong merge story

If you ran --squash but your notes say two parents, the project fails the graph gate. Rewrite the notes, not the remote history.

Issue still open

If Closes #1 was missing or named the wrong number, the issue stays open. Fix the pull request body before merge, or close it with a comment that names the miss and the number you actually closed.

Evidence package

  • Path from git rev-parse --show-toplevel and git remote -v for the GitHub repository you own.
  • Issue #1 body with problem, expected result, and reproduction.
  • gh pr view 1 and gh pr diff 1 from before the fix, showing the Pages URL.
  • Request-changes body and the follow-up commit ID from git log --oneline main..HEAD (or the equivalent range before you deleted the branch).
  • The merge flag you chose, a sketch of the graph, and git log --oneline --decorate --graph -n 12 after pull.
  • Matching SHAs from git rev-parse HEAD and git ls-remote origin refs/heads/main, plus gh issue view 1 showing closed.
Sanitize evidence

Redact tokens, passwords, and personal email if they appear. Repository URLs you own are expected. Do not screenshot credential helpers or SSH keys.

Self-assessment rubric: 25 points

NEEDS REVISION0–19 points

The feature landed on main without review, a push was forced, the issue is still open, or the graph does not match the merge flag.

SHIP STANDARD20–23 points

Issue, planted defect, request-changes, ordinary follow-up, named merge, matching tips, closed issue.

DISTINCTION24–25 points

Every GitHub comment names a clone risk a stranger can verify, the diff stayed on README.md, and evidence is exact.

5 · Issue first

Complete GitHub issue on a repository you own, filed before the feature branch.

5 · Proposed change

Short-lived branch, planted Pages URL, pull request with summary, verify steps, and Closes #1.

5 · Review conversation

Line comment plus gh pr review --request-changes; comments live on GitHub, not in git show.

5 · Follow-up and merge

Ordinary git push, then gh pr review --approve and one named gh pr merge flag.

5 · Final audit

Matching SHAs, closed issue, deleted feature branch, clean status, complete evidence package.

Automatic stop

Force-push, someone else's repository, a fork used as busywork on a famous project, pasted secrets, or merging without requested changes requires rebuilding safely.

Project checklist

  • I filed one complete GitHub issue on a repository I own, then branched.
  • I opened one pull request with Closes #1 and a planted Pages URL for review to catch.
  • I requested changes, then answered with git push on the same branch, not force-push.
  • I merged with a flag whose graph I can name, updated local main, and closed the issue through GitHub.
  • I never used a popular project as the lab or treated git pull as the pull request.

Final audit commands

git rev-parse --show-toplevel
git remote -v
git status
git fetch origin
git switch main
git pull origin main
git log --oneline --decorate --graph -n 12
git branch -vv
git rev-parse HEAD
git ls-remote origin refs/heads/main
gh pr view 1
gh pr view 1 --comments
gh issue view 1

Those commands answer one question: does the GitHub conversation (issue, review, merge) describe the same history as local main and origin/main? When they do, the unit project is complete. A check reviewers can trust is GitHub Actions.

Related lessons

  • GitHub Pull Requests — The project is the full review conversation.
  • GitHub Code Review — Line comments, requested changes, and a justified merge belong here.
  • GitHub Issues — Start from a problem that a pull request can close.
  • GitHub Contributing — Keep a small diff and answer review with an ordinary push.
  • GitHub Branch Protection — If main is protected, this pull request is the legal path to move it.
  • Git Branching Workflow — GitHub Flow: short-lived branch, reviewed merge, delete the branch.
PREVIOUS LESSONGitHub Contributing
NEXT LESSONGitHub Actions
ON THIS PAGEGit Project: Reviewed Pull RequestProject briefSafety boundaryRepository contractRequired conversation and graphsMilestone 1 · Host the clone cardMilestone 2 · File the issueMilestone 3 · Branch with a planted defectMilestone 4 · Open the pull requestMilestone 5 · Request changesMilestone 6 · Answer with an ordinary pushMilestone 7 · Merge and prove the graphRequired failure drillsEvidence packageSelf-assessment rubric: 25 pointsProject checklistFinal audit commandsRelated lessons
Course contents