Why Pull Requests?
A pull request allows members of a project to be notified of a proposed change. It also acts as a forum where the members can review the change and offer constructive feedback. Once approved the change can be merged into the branch.
When working within a team, or on any other project with multiple contributors, pull requests are an important tool for reasons we will go over now.
Code Quality
When used correctly, pull requests help to maintain a clean and high quality codebase. This in turn helps to prevent bugs from entering production code.
During a pull request reviewers can confirm the author’s logic, if the acceptance criteria has been met, adherence to project coding standards and much more as you can read in Reviewing a Pull Request.
Knowledge Sharing
Whether new or not, there is often knowledge either to learn or to pass on when interacting with other likeminded developers. Pull requests are a great learning opportunity for everyone involved.
As well as sharing new methodologies, shorter syntax options, the latest technologies etc, you also pass on the knowledge of the functionality itself. Having more people aware of the functionality means you won't need to rely on one person to work on this feature moving forward.
Streamlined Workflow
The last to mention, but by no means the least beneficial, is that all pull request activity gets tracked in one place. Comments can be left directly next to the changes and can begin a thread of conversation. These conversations can be seen by anyone with access to the project.
This streamlined workflow will save you lots of time and energy, as you won't need to be constantly searching through your emails and chat history.
If you're looking to make the best use of your pull requests, make sure to read our other posts on this topic.