I merge with Git and get a conflict. After having resolved the conflicts, upon commit I will see an auto-generated commit message containing a list of files which were in conflict. What is the best-practice - should I keep this list of conflicting files for a good reason or can I delete this part of the commit message?
A merge conflict is an event that takes place when Git is unable to automatically resolve differences in code between two commits. Git can merge the changes automatically only if the commits are on different lines or branches.
The only way to "accept both" would be to just re-stage (marking as resolved) the conflicted files without resolving them ( >>> and <<< would be there still), but your result couldnt be compiled or executed. And this is terrible practice, even if you make commits later to resolve.
For whatever it's worth, keep. If the file borks down the line, this helps you determine where a merge might have occurred with unintentional consequences.
Often, an "unconflict" involves judgement calls where the merger knows one branch better than the other (b/c s/he worked on it) or doesn't know either branch well at all. Relatively uninformed, even if well-meaning, judgement calls can often spell trouble. Easier to grep which merge unconflicted with those lines in there.
Your mileage may vary, I am not a lawyer.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With