Learn Programming, Tech & Coding · Free Online Tools

IT Question Answer
Back to GitHub
GitHub Pull Requests Explained

GitHub Pull Requests Explained

GitHub2,567 viewsBy Admin
githubpullrequests

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

  1. Create a feature branch.
  2. Make commits and push.
  3. Open a Pull Request on GitHub.
  4. Teammates review and comment.
  5. Make fixes if needed.
  6. 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

TypeResult
Merge commitKeeps all commits
SquashCombines into one
RebaseLinear 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.