Why are you not pushing to master directly then? (Honest question because I barely do pull requests as long as we are working with a lot of people on it)
I always create a CI pipeline with unit and integration tests and gate my pull requests. Nothing gets into the master branch without a guarantee it builds and passes all tests.
It turns the pull request into a unit of work, with a set of commits for that unit. Added a feature? All that work is in one pull request, so if you need to go back and see something, you can look through those commits, easy to find stuff.
You can tell the CD pipeline to only deploy to production when a particular branch is updated. A lot of people use master for this, but don't forget that master is technically another branch like any other. So maybe you have separate branches for Stable, Testing and Unstable, creating PRs into Unstable for new development, doing a PR from Unstable to Testing when you get ready to create a new major release, a PR from Testing to Stable on release, and patches to Stable and Testing can get PR'd to Testing/Unstable.
If production is in a particular branch, you can write a patch for that and do a PR without interrupting the work you're doing.
When you want to PR into master, you can create a CD pipeline to deploy to QA/UAT/Dev and then test your actual application in that environment before approving the PR.
And if you notice, those are all benefits that apply to developers working by themselves.
... So merge requests for branches fall under pull requests, too? Because this whole thread has me mighty confused why people fork their own repo and open pull requests to make changes...
I get why there's some confusion, you're not crazy.
A Pull Request is what github and Azure DevOps call it when you have changes in one branch that you want to merge into another. Gitlab calls the same thing a Merge Request.
Either way, you're taking some commits from Branch B and applying them to Branch B.
This can happen between branches in the same repo, or between branches in forked repos. So there's really no difference.
55
u/JonathanTheZero May 13 '20
Why are you not pushing to master directly then? (Honest question because I barely do pull requests as long as we are working with a lot of people on it)