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

后端 未结 27 2083
庸人自扰
庸人自扰 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:05

    On macOS Big Sur (11.0) beta for TextMate: none of the environment variable options worked. (Set all three: GIT_EDITOR, VISUAL, and EDITOR.)

    Finally set the global core.editor in git, and that worked:
    git config --global core.editor "~/bin/mate -w"

提交回复
热议问题