Exit Vim without committing changes in Git

后端 未结 4 1224
深忆病人
深忆病人 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:33

    To get git to not make a change when you are executing git commit --amend or git rebase -i.

    Just delete the message (and save). All git does is look for a non empty message to see if a valid commit happened. Since there is a commit message (because you commited something before) git thinks that its a valid commit or rebase.

提交回复
热议问题