我使用 Apache+mod_wsgi 托管的 django 项目。我正在尝试通过子进程使用 git 命令提取更新,例如:
subprocess.check_output(['git', 'pull', 'origin', 'mybranch'])
但是,我收到如下错误:
Command '['git', 'pull', 'origin', 'mybranch']' returned non-zero exit status 128
当我通过浏览器调用此函数时出现此问题。如果我subprocess.check_output(['git', 'pull', 'origin', 'mybranch'])
从 python sell 运行,就不会出错。它按预期完美运行。