DEV Community

Discussion on: why branching on git is wrong

Collapse
 
xvlcwkh profile image
Chris

If bad you remove that commit and make the developer pay for the next beers.

Removing that commit means you just doubled the merge conflicts and made bisecting impossible.

Sonarqube and CI work way better with Pullrequests where the commit is rated before being integrated into development. Have a single clean mergecommit instead of having a ton of reverts and "fixed spelling" on your mainbranch.

If you need to have a single Branch for your CI to work
you should configure your CI properly (build once after every push, always merge locally with target before building, let CI handle the final merge into target once the PR has enough approvals and a clean build) instead of giving up on branching and PRs.

If you need to have a single branch because of conflicts you need to rebase more often and most importantly keep your issues and thus your PRs smaller.