2

Hi im trying to setup a WebHook in Github.

I have used these instructions :

http://net.tutsplus.com/tutorials/other/the-perfect-workflow-with-git-github-and-ssh/

But for some reasons I'm not able to to the pull via my a php file.

But if im logged via ssh and I run:

$ php git-hook.php

its doing the pull properly but wont do it if the call if from Github or just load the page directly via a browser.

I have already setup chmod to 777.

Thanks a lot

Omega
  • 2,998
  • 2
  • 16
  • 19
ysaelpepin
  • 21
  • 1
  • 1
    Possible duplicate: http://stackoverflow.com/questions/12856907/git-webhook-will-not-pull-php/12890603#12890603 Most likely reason, is apache/php user doesn't have access to the `.ssh` file for your user. – Jon Apr 17 '13 at 19:48
  • thanks jon, I tried everything from that tread but nothing worked for me. Could it be the fact that I created my SSH key logged as root? – ysaelpepin Apr 22 '13 at 13:45
  • That would be a reason why. The ssh key would then be in the root directory under the `.ssh` folder, which the php/apache users can't access. – Jon Apr 22 '13 at 16:05

1 Answers1

0

Someone mentioned this problem in a comment in the tutorial page. Have you tried this solution? http://www.tegdesign.com/git-webhook-php-post-receive-pull-method/

Anyway, the tutorial shows how to clone the repo with the SSH url. If this is a preview server and you are using as preview only, you can use the HTTP url to clone.

Change this way of cloning:

git clone git@github.com:Your-User-Name/awesomeProject.git 

to this:

git clone https://github.com/Your-User-Name/awesomeProject.git
Guumaster
  • 389
  • 3
  • 10