Git提交在我创建提交消息并使用“提交”之前中止--“等等”;
我在Mac上使用Visual Studio代码作为文本编辑器,并将其设置为打开一个新窗口来键入提交消息,但是当我在终端中键入“git commit”时,它会立即显示 由于提交消息为空,正在中止提交 我将git config设置为Git提交在我创建提交消息并使用“提交”之前中止--“等等”;,git,visual-studio-code,git-commit,Git,Visual Studio Code,Git Commit,我在Mac上使用Visual Studio代码作为文本编辑器,并将其设置为打开一个新窗口来键入提交消息,但是当我在终端中键入“git commit”时,它会立即显示 由于提交消息为空,正在中止提交 我将git config设置为git config--global core.editor“code--wait”,当我键入git config--global-e时,它会显示 [core]editor=代码--等等 我已经卸载并重新安装了git,我已经通过了,并且已经在线搜索了至少十个小时的解决方案
git config--global core.editor“code--wait”
,当我键入git config--global-e
时,它会显示
[core]editor=代码--等等
我已经卸载并重新安装了git,我已经通过了,并且已经在线搜索了至少十个小时的解决方案。当我在命令行中键入git commit-m“message here”
时,我的git和VS代码版本是最新的,我的提交也可以工作,但我仍然不知道为什么我的VS代码编辑器选项不工作
有什么想法吗?谢谢大家! 我通过在终端中键入
open.bash\u profile
找到了编辑环境变量的方法,果然,我的默认设置上没有--wait
标志。我附加了一个可视人物的屏幕截图。感谢@evolutionxbox的创意
我对这个
code
编辑器一无所知,但是您可以自己在命令行上测试它的行为,从bash shell:运行code--wait
,看看它是否真的在等待您编辑该文件。若它并没有,那个么找到一些替代形式的命令,或者在code
中可能存在的任何设置,使它实际等待,或者其他任何设置。(当bash运行命令时,它会让命令运行到完成,然后打印另一个$
提示符,或将提示符设置为的任何内容。)@torek OP希望使用Visual Studio代码。我见过有人用code-wait
设置环境变量$EDITOR,这很有效。