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
git category.
Last Updated: 2024-11-23
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)