Pull Requests are a feature that makes it easier for developers to collaborate. Developers can view code, suggest changes and share ideas. On Bitbucket, they provide a user interface for discussing proposed changes before integrating them into branches.
Usually these branches are off-shoots of the branch you’re trying to merge into, called “feature” branches. Once their feature branch is ready, the developer files a pull request via their Bitbucket account.
If any issues are found in the Pull Request, or any changes or better ways of doing things are thought up, developers can suggest a change on a line-by-line basis. The branch owner would make the change requested, and re-commit their code. Once the code has been accepted, and then merged, the Pull Request is closed. The feature branch can then be deleted, too.
This is the basic workflow for a Pull Request:
- A developer creates a feature branch on their local environment.
- Once the code has been completed and tested, the developer commits and pushes their new feature branch to the repository.
- The developer creates a Pull Request.
- The Pull Request is reviewed by others, who then either accept it or suggest changes.
- The developer makes changes if he has to, or merges the code into the repository.
- The Pull Request can be closed and the feature branch can be deleted.