我試圖從PHP文件中讀取git pull
,但好像配置沒有被使用。通過PHP文件通過git pull時不使用git config
git config --global user.name
和git config --global user.email
被設置,git pull從命令行工作。
現在,當我試圖執行這個腳本:
<?php
header('Content-type: text/plain');
system('git pull 2>&1');
echo "\nCompleted!";
我得到以下輸出:
*請告訴我你是誰。
運行
混帳配置--global user.email 「[email protected]」 混帳配置 --global user.name 「你的名字」
設置您的帳戶的默認身份。省略--global僅在此存儲庫中設置 標識。
致命:空識別碼不允許
已完成!
這可能是因爲git config
是用戶specfic而PHP是從另一個用戶運行?
謝謝。我正在使用'system('/ usr/bin/env -i HOME =/home/myself git pull 2> &1');''。 – EsTeGe 2012-08-08 13:32:05