Sign in

Using PHP shell_ Exec needs GitHub account password to execute git pull

eeeeeen edited in Wed, 22 Jun 2022

Use PHP to do the webhook of GitHub, as follows:

        $cmd = "eval `ssh-agent -s` && ssh-add && cd $target && git pull 2>&1";
        $res = shell_exec($cmd);

SSH key (no password) has been added. No error is returned, but it is not successful.

$CMD = "CD $target & & git pull 2 > & 1"; will prompt no permission, because the key should not be loaded.

1 Replies
commented on Wed, 22 Jun 2022

Git remote - V to see is SSH or HTTPS connection, warehouse address mosaic below

lock This question has been locked and the reply function has been disabled.