有没有一种方法可以一次性在 git 命令上指定编辑器[重复]

问题描述 投票:0回答:1

如上所述,我正在寻找这样的东西:

$ git commit -m "我的第一次提交" --editor="vim"

这将允许我在一次运行中一次性交换编辑器。这可能有用的示例是压缩冗长的历史记录或为功能提交编写消息时。

git editor git-commit
1个回答
2
投票

您可以仅针对一次 git 执行覆盖

GIT_EDITOR
环境变量:

GIT_EDITOR=nano git commit -a
© www.soinside.com 2019 - 2024. All rights reserved.