Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Git auto generated merge commit message not prompted in intellij commit dialog

The auto generated git commit merge message used to be prompted to me automatically in the IntelliJ commit message dialog, and it suddenly stopped. If I use commit in the command line, I can see that git creates the correct merge commit message (with the branch names & conflict files), but IntelliJ doesn't suggest this message to me if I commit from IntelliJ.

What can I do to bring the auto generated git merge commit message automatically to the dialog box when I commit in IntelliJ?

like image 226
Opher Avatar asked Feb 25 '19 07:02

Opher


3 Answers

Solved! The problem was the the changelist in IntelliJ had a comment associated to it (value can be edited using the 'Edit Changelist' option). Once I cleared this value, the git merge commit message was properly suggested to me in the commit dialog.

To clarify:

  • In the "Local Changes" tab, find the changelist that is carrying the current changes (e.g. "Default")
  • Right-click the changelist and select "Edit Changelist"
  • Observe the "Comment" field - if it has a message, this will override the default behavior. To fix this, delete the text from the Comment field and select "Ok"
  • Click "Commit" again and the default merge Comment should be filled in now
like image 103
Opher Avatar answered Oct 19 '22 16:10

Opher


If the solution mentioned by Opher to clear the change-list comment field. not working, try this:

  1. go to Intellij settings

  2. navigate to: Version Controll, Commit Dialog

  3. uncheck this option: Clear initial commit message

intellij settings dialog version controll -> commot dialog

like image 2
Elhay Avichzer Avatar answered Oct 19 '22 18:10

Elhay Avichzer


In fact, Merge commit should appear. The thing is that if there are other commit message providers (e.g. some task server, or a message saved to the description of changelist, etc), they can overwrite the merge commit message.

So make sure the commit message is not coming from somewhere else. If it is some older commit message, but always the same, check Edit the Default changelist and check if there is something in the Description.

like image 1
Dmitriy Smirnov Avatar answered Oct 19 '22 17:10

Dmitriy Smirnov