How to amend a commit without changing commit message (reusing the previous one)?

前端 未结 6 1688
醉梦人生
醉梦人生 2020-11-27 08:52

Is there a way to amend a commit without vi (or your $EDITOR) popping up with the option to modify your commit message, but simply reusing the prev

6条回答
  •  时光取名叫无心
    2020-11-27 09:36

    Since git 1.7.9 version you can also use git commit --amend --no-edit to get your result.

    Note that this will not include metadata from the other commit such as the timestamp which may or may not be important to you.

提交回复
热议问题