Nothing magical. Mostly discipline.
If people need to do something like pull requests or wait for commits to be reviewed before merging with some kind of βmainβ repo or branch, try to make the time for review as short as possible.
You should probably try to shorten the life of the branch, but it really depends on the type of project you are working on.
Make the rule that all commits should be as small as possible. Make this rule that commits, should change only one. Make a rule not to mix cosmetic changes (for example, spaces) with functional changes and significant refactoring. (Don't ban whitespace changes completely - just separate them from other changes.)
In addition to version control, try assigning tasks to the coders in such a way as to reduce the likelihood that they change the same code in the same week or so.
source share