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

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

    When using git-review I had to modify sequence.editor value to be able to do interactive rebase (git rebase -i -p):

    git config --global sequence.editor "gvim"  # or whatever your prefer
    

    gvim require: apt install vim-gtk

    References

    • #2944 Interactive Rebase failed with warning: "Vim: Warning: Output is not to a terminal"
    • Install section of sjurba/rebase-editor

提交回复
热议问题