What is the shortcut for confirming dialogs on Mac?
In general in macOS, you can select the default dialog button (highlighted blue) with Enter.

                                                      

Enter selects the button on the right.

If you have All Controls enabled in System Preferences → Keyboard → Shortcuts, then a blue outline can be moved around controls using ⇥ and ⇧⇥, with Space used to confirm. In the screenshot, Space selects the button on the left.



However, specifically for this question you are referring to IntelliJ. They have a history of not following Apple HIG and there does not appear to be a keyboard shortcut to press the Commit button on that window.


  Click this button to commit the selected files, or hover your mouse over this button to […]


https://www.jetbrains.com/help/idea/2017.1/commit-changes-dialog.html