How to reduce conflicts in git
This is part of the
Semicolon&Sons Code Diary
- consisting of lessons learned on the job. You're in the
Last Updated: 2021-05-15
How to reduce merge conflicts?
- keep lines short (less reasons for it to change)
- (related) with objects, CSS etc., put only one "property" per line
- merge often. The longer branches diverge, the more headaches there will be.
- keep commits small & focused
- make sure everyone uses linters to limit divergence due to formatting preferences
- beware stray edits to whitespace (spaces/tabs/line returns)