GitHub Pull Requests: Choose Base and Head Branches
Propose rather than pull
A pull request (PR) is a hosted proposal to integrate changes, not the Git command git pull. The base branch is the destination; the head (compare) branch contains proposed work. For example, propose merging feature/notes into main, not the reverse. Opening or closing an unmerged PR does not itself integrate the commits. A draft PR shares unfinished work but cannot be merged until marked ready.
Inspect before opening
In the lab, main and feature/notes diverge from a common commit. Main adds policy.txt; the feature edits notes.txt. A three-dot diff compares the merge base with the feature tip, which approximates the PR change view for this simple graph. The endpoint diff instead also reflects changes made on main. Neither command creates a hosted PR. A PR comparison can differ from a fresh local comparison when the service uses a different merge base or the local refs are stale.
Hosted steps (manual, not executed)
Only in a repository you are authorized to modify, push the feature branch, open a new pull request in GitHub, select the correct base and compare branches, inspect files and commits, then add a description. Choose draft if the proposal needs work. Check repository and organization policies before requesting review. Do not push the lab to any actual service.
Practice example
git diff --name-status main...feature/notesgit diff --name-status main feature/notesIn the lab before integration: three-dot shows M notes.txt; endpoint comparison shows M notes.txt and D policy.txt. The latter is not a request to delete policy.txt.
Check your understanding
Choose base and head for proposing notes changes to main. Predict why policy.txt is absent from the three-dot diff.
Check Your Understanding
Solidify your learning with the interactive assessment directly below this lesson.
Concept Quiz & Questions
GitHub Pull Requests: Choose Base and Head Branches — knowledge check
Reason about pull request workflows and integration history.
Which branch is base for merging feature/notes into main?
What does opening a pull request do?
What does main...feature/notes compare in git diff?
What is true of a draft PR?
What happens when an unmerged PR is closed?