Say I run git pull
and there is a conflict that git cannot automatically merge.
After I manually merge the changes, and run git commit
, should I leave the Conflicts:
section that git generates in the commit (as a record that those files were manually merged), or removed it (as the conflict is not being committed)?
I'm never sure what best practice is - is the warning there to make sure you fix the conflicts, or to be actually logged in the commit message?
A merge conflict is an event that occurs when Git is unable to automatically resolve differences in code between two commits. When all the changes in the code occur on different lines or in different files, Git will successfully merge commits without your help.
This seems like a personal opinion type of question, so I'll answer with my opinion [-;
I leave the Conflicts
section alone as a reminder down the road that this merge produced conflicts. Occasionally I don't handle the conflicts appropriately, and it will produce some undesired effect later, so it's nice to be able to look through the commit history and see that there was a conflict in a file.
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