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

后端 未结 27 2451
庸人自扰
庸人自扰 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 01:56

    Atom as your git editor

    git config --global core.editor "atom --wait"
    

    Atom needs to be configured to run from the command line for the above to work:

    OS X: install shell commands from Atom: menu bar > Atom > Install Shell Commands

    Windows: no action required - atom is configured to run from the command line by default

提交回复
热议问题