2

We are planning to use Git pull requests for code review in our company. Before we start I have a basic question: How often should I open a pull request? Is it best to open one for every little commit I create? Or should I open a single pull request for a larger quantum of work, such as all the commits in, say, a user story? What is the right size?

What do you do in your team?

closed as too broad by gnat, user40980, Kilian Foth, GlenH7, Ampt Oct 13 '14 at 21:05

Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

  • Sharing your research helps everyone. Tell us what you've tried and why it didn’t meet your needs. This demonstrates that you’ve taken the time to try to help yourself, it saves us from reiterating obvious answers, and most of all it helps you get a more specific and relevant answer. Also see How to Ask – gnat Oct 8 '14 at 17:58
9

open a single pull request for a larger quantum of work, such as [...] a user story?

That's what you should do.

Two reasons:

  • There is a mantra that one should "commit early and often". Once you get used to it, you will recognize that this is a good habit. The side effect of it is, that you will produce a larger number of commits, which you may or may not want to squash later into fewer ones. That's perfectly ok as long as you didn't publish the stuff in any way.

  • Once you're finished with your work and want it to be merged, you open a PR. Keep in mind that the people who are acting upon your PR are not interested in every single minorish step of the development. They want a completed feature as a whole, because they will have to review it.

One major point about DVCS is exactly that: There is no need to publish every tiny step, but you still have the benefits of a repository. Once the branch is merged into the main development branch and/or repository you are contributing to via PRs, typically only the end result is of interest.

Not the answer you're looking for? Browse other questions tagged or ask your own question.