Pull Request
Pull requests (PRs) are used to recommend the merging of code from one branch into a different branch. PRs are a core tool in open-source software development as it allows developers to propose changes to large, open-source codebases.
After reviewing, if the changes are approved by the author(s)/collaborators of the repository, they are merged into the base branch (this is usually named the main
branch). If the changes are not approved, the maintainer(s) may either ask the requester for additional changes or decline the PR altogether.
The review process by the contributors, usually involves:
- Examining the code submitted in the PR for errors and/or optimizations.
- Running tests to ensure the code works as intended.
- Discussing potential modifications.
PRs are featured on popular version control platforms such as GitHub and GitLab.
Create a Pull Request
Method 1: Fork (Ideal for Open Source Projects, Conditionally Required)
- Fork the project.
- Clone the forked repository to your local machine.
- Create a new branch, then switch to it.
add
,commit
, andpush
the changes to your forked repository.- From the web page of your forked repository, click on the “Pull requests” tab.
Note: Forking a repository is only needed when the user lacks write access to the original repository or wants to make changes without affecting the original repository.
Method 2: Collaborators (Ideal for Small Teams)
If you are a collaborator of a repository (meaning the repository owner has added you as a collaborator), you can:
- Clone the repository to your machine.
- Create a new branch, then switch to it.
- Make your changes,
commit
, and thenpush
the branch to the repository. - From the web page of the repository, click on the “Pull Requests” tab.
Method 3: Within an Organization/Company
If you are part of an organization/company, depending on your permissions, you may have the privilege to push branches directly and create PRs (Pull Requests). You can follow the same steps as Method 2 to create a PR.
Note: Regardless of the method you choose, be sure to follow the contribution guidelines and standards specific to the project you are working on.
No matter which method you use, you need to visit the relevant repository to access the PRs (Pull Requests).
Navigate to the repository of the relevant project and go to ‘Pull requests’.
Once on the page, you’ll see a blue button labeled ‘New pull request’; click on it.
Finally, you just need to configure your Pull Request (PR), specifying the destination repository and branch, as well as the source branch and repository.
All contributors
- Anonymous contributor
- benoitBon-Lanon3393343016
- christian.dinh
- BrandonDusch
- liye0
- Anonymous contributor
- YanisaHS
- Anonymous contributor
- Anonymous contributor
Contribute to Docs
- Learn more about how to get involved.
- Edit this page on GitHub to fix an error or make an improvement.
- Submit feedback to let us know how we can improve Docs.