GitHub Pull Requests Explained
Ad
What is a Pull Request?
A Pull Request (PR) proposes changes from one branch to another. It's how teams review code before merging — the heart of GitHub collaboration.
The PR Workflow
- Create a feature branch.
- Make commits and push.
- Open a Pull Request on GitHub.
- Teammates review and comment.
- Make fixes if needed.
- Merge when approved.
Creating a PR
git checkout -b fix-login
# make changes
git commit -m "Fix login bug"
git push -u origin fix-login
# GitHub shows "Compare & pull request" button
Good PR Practices
- Keep PRs small and focused.
- Write a clear title and description.
- Link related issues (
Closes #42). - Respond to review comments promptly.
Merge Options
| Type | Result |
|---|---|
| Merge commit | Keeps all commits |
| Squash | Combines into one |
| Rebase | Linear history |
FAQs
PR vs merge request?
Same thing — GitHub calls it PR, GitLab calls it MR. More in our GitHub section.
Can I edit a PR after opening?
Yes — just push more commits to the same branch.
