是否可以为不同的git命令配置不同的编辑器?
说
或者是否有一些脚本可以充当中介并分析我执行的命令类型,然后写下我想要的编辑器?
小智 7
您可以使用core.editor和sequence.editor设置.core.editor将用于提交,并将sequence.editor用于交互式变基:
git config --global core.editor nano
git config --global sequence.editor <path to sublime text>
Run Code Online (Sandbox Code Playgroud)
从官方Linux Kernel Git文档中git config:
Run Code Online (Sandbox Code Playgroud)core.editor诸如commit和tag之类的命令允许您通过启动编辑器来编辑消息,在设置它时使用此变量的值,并且未设置环境变量GIT_EDITOR.见git-var(1).
Run Code Online (Sandbox Code Playgroud)sequence.editor
git rebase -i用于编辑rebase insn文件的文本编辑器.该值在使用时由shell解释.它可以被GIT_SEQUENCE_EDITOR环境变量覆盖.未配置时,将使用默认提交消息编辑器.
| 归档时间: |
|
| 查看次数: |
546 次 |
| 最近记录: |