【发布时间】:2016-06-25 21:36:18
【问题描述】:
我有一个带有 Web 界面的 PHP 脚本,用于向现在自动化的流程提供输入。我试图通过 PHP 的 exec 执行 git 命令,在此过程中包括提交和推送到 Git。我能够拉入远程存储库,添加文件并获取它的状态。但是,我在尝试提交更改时遇到了问题。
当我尝试提交时,我得到:
[0] =>
[1] => *** Please tell me who you are.
[2] =>
[3] => Run
[4] =>
[5] => git config --global user.email "you@example.com"
[6] => git config --global user.name "Your Name"
[7] =>
[8] => to set your account's default identity.
[9] => Omit --global to set the identity only in this repository.
[10] =>
[11] => fatal: unable to auto-detect email address (got 'tim@tim.(none)')
据我了解,Git 没有解析我在 ~/.gitconfig 的全局配置,它可以在通过终端正常执行时完成。我在我的用户和组下运行 Apache。当我尝试运行上面建议的命令时,我得到:
[0] => fatal: $HOME not set
我该如何解决这个问题?
【问题讨论】:
标签: linux git terminal automation