Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"Edit commit message" function in IntelliJ

Trying to understand, why the Edit commit message function became unavailable.

Any ideas? I'm sure - it's was working before .

enter image description here

like image 877
Ray Cobain Avatar asked Sep 10 '25 18:09

Ray Cobain


2 Answers

According to the docs, this happens because IntelliJ thinks that branch is protected. Fortunately, the same docs provide information on how to configure such branches.

Go to Project Settings (Cmd + , on MacOS | Ctrl + Alt + s on Windows) -> Version Control -> Git and, in the "Push" section, remove the protected branch you want to push altered history to.

You cannot modify the history for protected branches where push --force is not allowed (configure protected branches in the Version Control | Git page of the IDE settings ⌘Сmd, . Note that if a branch is marked as protected on GitHub, IntelliJ IDEA will automatically mark it as protected when you check it out.

Be aware, however, that if the remote branch is indeed protected, you will not be able to push any altered history.

like image 105
Vlad Muresan Avatar answered Sep 13 '25 12:09

Vlad Muresan


This doesn't directly answer your question within Intellij, however it allows you the edit a pushed commit message.

If you wanted to edit the 6th commit message:

git rebase -i HEAD~6
like image 26
Vic Stalkeur Avatar answered Sep 13 '25 13:09

Vic Stalkeur