更新 Mac OS 后 Git 提交问题

Kri*_*thy -3 git commit pre-commit-hook git-commit

更新到最新版本后,我在 Mac 操作系统中收到以下提交错误。尝试重新启动 VS Code,也尝试使用终端,但出现同样的错误。直到git add .这一步工作正常。只有提交命令无法正常工作。可能是什么问题?

在此输入图像描述

 git commit -m "Commit message"
.git/hooks/pre-commit: line 15: python: command not found
.git/hooks/pre-commit: line 16: python: command not found
Run Code Online (Sandbox Code Playgroud)

Gho*_*ica 6

MacOs 12.3 更新删除了内置的 python 2.7 客户端。

选项:

  • 手动安装 python 2.7,例如从这里
  • 查看预提交文件:也许可以更新为使用 python3(当然需要安装它)