Under the hood
What is a pull request? Code review explained for beginners
A pull request is how developers propose and review changes before merging. How pull requests work, what good reviews look like, and why AI makes them vital.
By the GenKid team · · Updated · Facts checked · 4 min read
Key takeaways
- A pull request (PR) is a proposal to merge a set of code changes into a project, so others can review them first.
- Reviewers look at the changes, ask questions, request improvements and approve when it's ready.
- Pull requests catch bugs early, share knowledge and keep a record of why changes were made.
- AI coding agents can open pull requests too, which makes careful human review even more important.
- Small, focused pull requests with clear descriptions are easier to review well.
What is a pull request?
A pull request is a proposal to merge a set of code changes into a project, so other people can review them first. GitHub's own documentation describes pull requests as "proposals to merge code changes into a project".
When developers work on a shared project, they don't usually change the main code directly. Instead, they make changes on a separate branch, then open a pull request asking for those changes to be added to the main branch.
A pull request shows:
- what changed — every line added or removed (the diff);
- why — a description written by the author;
- the conversation — questions, comments and suggestions from reviewers;
- checks — automatic tests that run on the changes.
When reviewers are happy, the changes are merged into the main branch.
How a pull request works, step by step
- Create a branch for your change.
- Make commits on that branch.
- Open a pull request, describing what you changed and why.
- Reviewers read the diff, test it and leave comments.
- Respond and update — answer questions, make requested changes.
- Approve and merge when everyone's satisfied.
You can also open a draft pull request to share work in progress without asking for formal review yet. On GitHub, draft pull requests can't be merged until they're marked ready.
Pull request vs merge request
They're the same idea with different names. GitHub calls them pull requests; GitLab calls them merge requests. Both are a place for a team to review proposed code changes, discuss them and track them before merging.
What good reviewers look for
A code review isn't just "does it work?". Reviewers ask:
- Does it do what the description says?
- Are there bugs or edge cases? See testing for beginners.
- Is it safe? No secrets in code, user input handled properly. See API keys and secrets.
- Is it clear? Would someone else understand it in six months?
- Is it the right approach? Is there a simpler way?
Good review comments are specific and kind: "This breaks when the list is empty — could you add a check?" rather than "This is wrong."
Writing a good pull request
| Do | Avoid |
|---|---|
| One focused change per PR | Mixing several unrelated changes |
| A clear title: "Fix score not resetting on Play again" | "Updates" |
| Explain why, not just what | Leaving the description empty |
| Mention how you tested it | Assuming reviewers will figure it out |
| Keep it small enough to review in one sitting | Hundreds of changed lines |
Pull requests and AI
AI coding agents can now make changes and open pull requests on their own. That's powerful — but it means the review step matters more than ever. An AI's pull request can look tidy and confident while containing bugs, security problems or invented packages.
Reviewing an AI's pull request uses exactly the same skills as reviewing a person's:
- read the diff line by line;
- run it and test the edge cases (and if something breaks, debug it before merging);
- ask for changes when something's wrong;
- only merge what you understand.
Our checklist for AI-generated code is a good place to start.
Why this matters for young developers
Being able to read, discuss and review code changes is one of the most valuable skills in modern software teams. It's also a great way to learn: reviewing other people's code exposes you to new ideas, and getting your own code reviewed helps you improve quickly.
In GenKid, learners review every change the coding agent proposes from Level 1, accepting or rejecting each one. At Level 3, the Git & GitHub course teaches commits, branches, pull requests and code review in a practice Git sandbox, so no GitHub account is needed. See the pathway.
Frequently asked questions
Why is it called a pull request?
Because you're asking the project to "pull" your changes from your branch into the main code. Some services call it a merge request instead.
Who reviews a pull request?
Usually teammates or project maintainers. In solo projects, you can review your own PRs, which is still useful for catching mistakes.
What does "merge" mean?
Merging combines the changes from one branch into another, usually into the main branch once a pull request is approved.
Can AI review pull requests?
AI can help spot some problems, but it can also miss issues or approve mistakes. A person who understands the code should make the final decision.
Sources
- About pull requests (opens in a new tab) — GitHub Docs
- About version control (opens in a new tab) — Pro Git
- Merge requests (opens in a new tab) — GitLab Docs
How we write: GenKid articles are researched and drafted with the help of AI tools, then checked in a separate review step against the sources listed above before they are published, and re-checked when they are updated. Rules and products change, so check official pages for your country before acting on anything here. This article is general information, not legal advice. Spotted a mistake? Email hello@genkid.app.