Say you commit, pull, have a conflict, resolve the conflict, and then commit. Since the local change already has a commit with a meaningful message and the remote change being pulled has its meaningful commit messages too, what should the message be for the commit that resolves the conflict? Often I find myself making no major changes to resolve the conflict, leaving me with just, "Resolving conflict."

What should one write here, such that the commit has a meaningful message?

closed as primarily opinion-based by gnat, Greg Burghardt, Bart van Ingen Schenau, user22815, Robert Harvey Feb 3 '17 at 19:24

Many good questions generate some degree of opinion based on expert experience, but answers to this question will tend to be almost entirely based on opinions, rather than facts, references, or specific expertise. If this question can be reworded to fit the rules in the help center, please edit the question.

  • 4
    I believe git automatically generates one for you if you just do git commit without the -m parameter. – Matthew Jan 31 '17 at 18:33

You write whatever the convention is for commit messages in your team. Many teams have certain conventions for commit messages because you use them to create a change log, something like this one:

<type>(<scope>): <subject>

If you don't have a convention, then think about the rest of the messages you use to commit. What do you write for those? Something useful, no doubt.

For example, Git generates a default message that tells you the files that were in conflict. I find that default message very useful and keep it. I find it useful because sometimes (in the project I used to work) bugs were introduced by my team members by badly resolving some conflicts. Later when I chased some bug and wanted to know what has happened with the source code lately, I first looked for the "usual suspects" inside the commit message, before doing anything else.

So think about what would be useful for you (or your team) as a conflict message, then go with that. If you resolve the conflict with minor changes then "Resolving conflict" is enough otherwise (emphasis mine):

If you think it would be helpful to others looking at this merge in the future, you can modify this commit message with details about how you resolved the merge and explain why you did the changes you made if these are not obvious.

  • Thank you for the answer but I am not asking about how to write a good commit message. I'm specifically asking how to describe a merge conflict resolution beyond "resolving merge conflict." – ybakos Feb 1 '17 at 21:22
  • I’ve completed/emphasized some parts of my answer. But beyond "explaining how and why you resolved the conflict if not already obvious", I’m not sure what kind of response you are expecting exactly... – Bogdan Feb 3 '17 at 12:31

Not the answer you're looking for? Browse other questions tagged or ask your own question.