Sara Shokry
Sara Shokry

Reputation: 46

Automate push to github in laravel project

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

Upvotes: 0

Views: 558

Answers (1)

Charles Marceau
Charles Marceau

Reputation: 93

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');

Upvotes: 1

Related Questions