TortoiseGit Git 来自脚本的提交消息
TortoiseGit Git Commit message from script
我在 TortoiseGit 中生成了 Start Commit Hook,它调用 StartComit.bat 文件并启用选项 "Wait for the script to finish" .
bat文件内容为
echo "Some more info...." >> %1
正在调用脚本 before 提交对话框打开但它不工作,我在消息字段中没有收到任何文本。
我做错了什么?
编辑:为了让问题更清楚,我正在尝试放弃这个已接受的答案 并做类似的事情。
%1 是启动提交对话框时包含所有选定文件的文件路径,而不是消息 %2 的文件路径。
有关参数的手册,请参阅 https://tortoisegit.org/docs/tortoisegit/tgit-dug-settings.html#tgit-dug-settings-hooks。
因此,
echo Some more info.... >> %2
应该可以解决这个问题。
我在 TortoiseGit 中生成了 Start Commit Hook,它调用 StartComit.bat 文件并启用选项 "Wait for the script to finish" .
bat文件内容为
echo "Some more info...." >> %1
正在调用脚本 before 提交对话框打开但它不工作,我在消息字段中没有收到任何文本。
我做错了什么?
编辑:为了让问题更清楚,我正在尝试放弃这个已接受的答案 并做类似的事情。
%1 是启动提交对话框时包含所有选定文件的文件路径,而不是消息 %2 的文件路径。
有关参数的手册,请参阅 https://tortoisegit.org/docs/tortoisegit/tgit-dug-settings.html#tgit-dug-settings-hooks。
因此,
echo Some more info.... >> %2
应该可以解决这个问题。