0

I'm trying to add, commit & push to github using php code from Laravel controller using:

shell_exec('git add . && git commit -m "Nero" && git push origin master');
system('git add . && git commit -m "Nero" && git push origin master');
  1. The code added files changed successfully.
  2. The code commit successfully.
  3. It takes too long time and still didn't push the code.

I tried a lot of commands and it successfully run, the problem is in

git push

git push origin master
2
  • Do you have an error message ? Commented May 28, 2019 at 15:20
  • at first I got no response for long time then I got "Maximum execution time of 120 seconds exceeded" so I increased the execution time but I still didn't have a response Commented May 29, 2019 at 7:27

1 Answer 1

1

Are you sure your git credentials are correctly configured? My guess is that the push command is waiting for you to enter your Github username/password.

You could verify by getting the shell_exec output like this:

$output = shell_exec('git add . && git commit -m "Nero" && git push origin master');
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.