【问题标题】:Automate push to github in laravel project在 laravel 项目中自动推送到 github
【发布时间】:2019-10-14 02:49:38
【问题描述】:

我正在尝试使用来自 Laravel 控制器的 php 代码添加、提交和推送到 github:

shell_exec('git add . && git commit -m "Nero" && git push origin master');
system('git add . && git commit -m "Nero" && git push origin master');
  1. 代码添加文件更改成功。
  2. 代码提交成功。
  3. 时间太长了,还是没有推送代码。

试了很多命令,运行成功,问题出在

git push

git push origin master

【问题讨论】:

  • 你有错误信息吗?
  • 一开始我很长时间没有反应然后我得到“超过120秒的最大执行时间”所以我增加了执行时间但我仍然没有反应

标签: php git laravel-5 github


【解决方案1】:

您确定您的 git 凭据配置正确吗?我的猜测是 push 命令正在等待你输入你的 Github 用户名/密码。

您可以像这样获取 shell_exec 输出来验证:

$output = shell_exec('git add . && git commit -m "Nero" && git push origin master');

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2013-06-21
    • 1970-01-01
    • 1970-01-01
    • 2016-05-21
    • 1970-01-01
    • 1970-01-01
    • 2014-01-06
    • 1970-01-01
    相关资源
    最近更新 更多