How do I make Git use the editor of my choice for commits?

后端 未结 27 2095
庸人自扰
庸人自扰 2020-11-22 01:33

I would prefer to write my commit messages in Vim, but it is opening them in Emacs.

How do I configure Git to always use Vim? Note that I want to do this globally,

27条回答
  •  长情又很酷
    2020-11-22 02:18

    For Windows users who want to use Kinesics Text Editor

    Create a file called 'k.sh', add the following text and place in your home directory (~):

    winpty "C:\Program Files (x86)\Kinesics Text Editor\x64\k.exe" $1
    

    At the git prompt type:

    git config --global core.editor ~/k.sh
    

提交回复
热议问题