2
deck
When to Use Pull Requests?
PR (Pull Request)
is primarily used in the following situations:
- As a way to share code changes with your team
- To improve code quality through review and feedback
- As the gateway for the code to eventually merge into the main branch
Common PR-Related English Expressions
Expression | Meaning |
---|---|
open a pull request | To create a pull request so others can review and discuss your code |
submit code for review | To send your code to be reviewed by team members or maintainers |
request changes | To suggest that the author revise specific parts of the code |
approve the PR | To confirm that the pull request is acceptable and can be merged |
leave a comment | To write feedback or questions directly on the code or PR discussion |
resolve conflicts | To fix overlapping changes between branches that prevent merging |
merge the PR | To combine the pull request into the main branch |
steps to reproduce | A detailed list of actions that consistently cause a bug to occur |
code snippet | A small, focused section of code used for explanation or discussion |
===
What is a PR Template?
Creating a template file in the .github/PULL_REQUEST_TEMPLATE
directory can guide an author to maintain a consistent format when writing a PR.
It usually includes the following types:
- Feature Addition
- Bug Fix
Feature Addition PR Template Example
## Description
Briefly describe the feature you added.
## Related Issue
Closes #[issue-number]
## Changes
- Added ...
- Updated ...
## Screenshots (if applicable)
[Insert screenshots]
## Checklist
- [ ] Tests added
- [ ] Docs updated
A feature addition PR template should clearly communicate what was changed, why, and how.
===
Bug Fix PR Template Example
## Bug Description
What was the bug?
## Fix Description
How did you fix it?
## Related Issue
Fixes #[issue-number]
## Test Coverage
- [ ] Confirmed fix in local
- [ ] Added regression test
A bug fix PR template should explain the cause of the bug, the fix, and whether it has been tested.
===
Want to learn more?
Join CodeFriends Plus membership or enroll in a course to start your journey.