Exit Vim without committing changes in Git

后端 未结 4 1228
深忆病人
深忆病人 2020-12-24 10:42

When I use git commit --amend or git rebase -i, vim opens up for me to make changes. If I then change my mind and exit vim without making any chang

4条回答
  •  孤城傲影
    2020-12-24 11:32

    :cq!
    

    This will force an error to Vim and it will not save any changes. Link to Vim manual.

    You may want to use cq without ! if you want vim to exit with an error and without saving.

提交回复
热议问题