Avoiding conflicts
Avoiding conflict is generally a good thing to do, and in the case of Git, it is a very good thing indeed. Rather than having to resolve a whole lot of conflicts all at once, you really want to catch those conflicts as you go (and thus handle just one or two at a time). If you are on a team, some conflicts cannot be avoided, but there are two good rules of thumb to cut down drastically on the work involved in handling conflicts:
- Do not have more than one programmer working on any given file (if possible)
- Merge main into your feature branch very frequently
Notice #2 does not say to merge your feature branch into main, but rather the other way around. This will not endanger the main thread, but will quickly reveal if there are any conflicts so far. If so, you can fix them in your branch and move on.