I used below code :
echo exec("git add . "); //this is working
echo exec("git commit -am 'first commit' "); //also working
echo exec("git push origin master"); //NOT WORKING, also not showing any error .
I chowned folder permissions from user to www-data . So, some git commands are working but
GIT PUSH ORIGIN MASTER
is not working from php exec . What is the solution ? Also, please tell me why PUSH in exec NOT showing any error or msg, how can i see those msgs . Also,if possible, please provide me any good links for more advanced use of git commands from php exec .
Update : I also tried this : I added post-commit hook by creating file .git/hooks/post-commit
I added this code to it :
git push origin master
But I didnt get any msg or error after commiting, it just commited but didnt do any push.
Thanks !
git push origin masternormally viaterminal? What was the result? BTW, which directory is it getting executed?