Git: How to edit/reword a merge commit's message?

后端 未结 7 1900
有刺的猬
有刺的猬 2020-12-07 08:40

How do I edit or reword a merge commit\'s message?

git commit --amend works if it\'s the last commit made (HEAD), but what if it comes befo

7条回答
  •  Happy的楠姐
    2020-12-07 09:32

    For current Git versions (Mai 2020):

    git rebase -i -r ,

    then replace in the editor merge -C ... with merge -c ....

    This will open the commit message in the editor during rebasing, where you can change it.

    (Thanks to VonC for the hint.)

提交回复
热议问题