Amending the message of Git commit made before a merge

后端 未结 2 1112
礼貌的吻别
礼貌的吻别 2020-12-29 04:00

I committed some test code before merging in a remote branch. This merge had a lot of conflicts and took some serious time to put right. So my history looks something like t

2条回答
  •  孤独总比滥情好
    2020-12-29 04:44

    If and only if your colleagues have not pushed/pulled the changes ontop of f3e71c2 elsewhere, this will work. Otherwise I don't know what will happen. Changing the commit message is entirely cosmetic (== metadata change), given that you haven't pushed the commit you want to amend yet, but this could still result in history confusion if your colleagues have pushed/ pulled any part of the history which is atop it.

    (thanks to Abizern for pointing out this failure-mode)

提交回复
热议问题