【发布时间】:2019-02-11 14:56:19
【问题描述】:
上下文
系统信息(Windows)
OS Name: Microsoft Windows 10 Pro
OS Version: 10.0.17134 N/A Build 17134
...
System Type: x64-based PC
Processor(s): 1 Processor(s) Installed.
[01]: Intel64 Family 6 Model 158 Stepping 10 GenuineIntel ~3696 Mhz
BIOS Version: American Megatrends Inc. 2.20, 10/27/2017
系统信息 (WSL)
OS: Debian
Kernel: x86_64 Linux 4.4.0-17134-Microsoft
Shell: zsh 5.3.1
CPU: Intel Core i7-8700K CPU @ 3.696GHz
RAM: 8041MiB / 16344MiB
Git
我的~/.gitconfig 中有这个:
[core]
editor = code --wait
问题:
当我运行git commit 时,vscode 以C:\mnt\$PathToRepo$\.git\COMMIT_EDITMSG 开头,但是这个文件是空的(它应该有要提交的更改+一个差异)。
当我编写提交消息,保存并退出时,我在终端中得到了这个:
Aborting commit due to empty commit message.
注意:
当我这样做时:
运行
git commit;在 vscode 中写入提交信息(例如:Initialize repo),保存并关闭;
在
Aborting commit due to empty commit message.之后,我再次运行git commit;
VSCode 将使用我在第 2 步中编写的相同提交消息打开(即:Initialize repo)
【问题讨论】:
-
我至少可以确认我看到了同样的东西。我正在使用来自github.com/andy-5/wslgit 的wslgit,但这似乎没有任何帮助。我想这个问题可能是由于 linux vs windows 上的 tmp 文件处理造成的?我会在这里看答案:)
标签: git visual-studio-code windows-subsystem-for-linux commit-message