Easier to read with cream paper, a tint, more contrast or larger text? Choose your colours and text, once, for every page.

Preview

Git: pull requests and review

This is the first page of the lesson. Read it and have a go at the activities. The rest is in the full lesson.

40 minutes

Another person reads it first

You fix a bug and merge it. Later the site breaks. You did not see the mistake in your own change.

Teams use review to solve this. Before a change joins the shared code, somebody else reads it. A pull request is the tool for this. It asks to join your work into the main code, and others can read it first.

Key words

WordWhat it meansExample
Pull requestA request to join your branch into main, which others can read and discuss.Add contributing rules
ReviewAnother person reads your change and says if it is good.Please fix the typo
PushSend your commits to the server.git push
PullBring new commits from the server to your computer.git pull
Commit messageA short note that says what a commit changes and why.Fix login for names with spaces
BranchA separate line of work.add-contributing
ServerA computer that holds the shared copy of the project.Gitea
RepositoryA folder of files with all its history.hello-git

The cells students fill in are left blank in this preview.

Start the lab first

data-callouts.note.label

Press Start the lab on the bar at the top of this lesson. Wait until it says it is running. Press Gitea on the same bar to open it in a second tab. Keep that tab open: you use it in step 3.

1. A fresh copy

Tell Git your name and email. Then clone the project (make your own copy) into a folder called review. Then go into the folder.

Command
git config --global user.name "Student"

A command for the lesson’s lab terminal. It is shown here and not run.

Command
git config --global user.email "[email protected]"

A command for the lesson’s lab terminal. It is shown here and not run.

Command
git clone http://student:student@gitea:3000/student/hello-git.git review

A command for the lesson’s lab terminal. It is shown here and not run.

Command
cd review

A command for the lesson’s lab terminal. It is shown here and not run.

2. Make a change on a branch

Add a file with a rule for the team. Then push (send) the branch to the server. The branch is now on the server. Main is not changed.

Command
git switch -c add-contributing

A command for the lesson’s lab terminal. It is shown here and not run.

Command
echo "Write a clear commit message for every change." > CONTRIBUTING.md

A command for the lesson’s lab terminal. It is shown here and not run.

Command
git add CONTRIBUTING.md

A command for the lesson’s lab terminal. It is shown here and not run.

The lesson goes on

12 more parts of this lesson are in the full curriculum, with the tasks, the final check and the labs. A college account gives your students all of it.