Pull Requests
A Pull Request (PR) is a way to notify team members that you've completed a feature or fixed a bug. It's a
request to merge your changes from one branch (compare) into another branch (base). PRs are crucial for code
review and team collaboration, allowing discussion and refinement of code before it's merged into the main
codebase.
Use Cases:
- Submitting new features for review
- Proposing bug fixes
- Collaborating on code changes with team members
- Getting feedback on work-in-progress code
- Contributing to open source projects
Creating and Managing Pull Requests:
1. Create a feature branch locally:
git checkout -b feature-branch
Always work in a separate branch for PRs
2. Push branch to remote:
git push origin feature-branch
Make your changes available on GitHub
3. Create PR on GitHub:
Step 1: Access Pull Request Creation
Navigate to your repository on GitHub. If you recently pushed changes, you'll see a "Compare & Pull Request" button.

Step 2: Select Branches
If no "Compare & Pull Request" button appears, click the "New pull request" button and select your branches.

Step 3: Review Changes
Review the comparison between branches, including commits and changed files.

Step 4: Finalize Pull Request
Add a descriptive title and detailed description explaining your changes. Then click "Create pull request" to submit.

Important Notes:
- Base branch is typically 'main' (where you want to merge TO)
- Compare branch is your feature branch (where your changes are)
- Write clear titles and descriptions to help reviewers understand your changes
- Review all changes before submitting to ensure everything is included
4. Update PR after feedback:
git add .
git commit -m "Address PR feedback"
git push origin feature-branch
git commit -m "Address PR feedback"
git push origin feature-branch
The PR updates automatically when you push changes
5. Handling reviewer comments:
# View PR comments on GitHub
# Respond with:
- 👍 to acknowledge
- Add follow-up comment
- "Resolve conversation" when fixed
# Respond with:
- 👍 to acknowledge
- Add follow-up comment
- "Resolve conversation" when fixed
6. Final PR checks:
# Before merging, ensure:
- All comments resolved
- Required reviews completed
- All changes tested locally
- No merge conflicts
- All comments resolved
- Required reviews completed
- All changes tested locally
- No merge conflicts
Best Practices:
- Write clear PR descriptions explaining what and why (not just how)
- Keep PRs focused and reasonably sized
- Respond promptly to reviewer feedback
- Test your changes before submitting
- Update your PR branch with the latest base branch changes