I am having a few problems setting it up on the production server though (works fine locally.)
I expect to do with user access to the repository? It’s a private github repository, but I can git via the cmd line, because the server has ssh key. The panel users don’t have their own repository access that matches their name/email, but I don’t think that should matter?
current error message when loading panel:
Error without a useful message :(
It happened here:
First of all you should connect to your server via SSH and check:
if ssh github.com outputs a message with your username. If it doesn’t, generate an SSH key on the server and add it to your repository as deploy key with push access.
if you can then push and pull inside your repository on the server.
If that works, the next issue could be that the git binary is not in the $PATH of the PHP execution environment (meaning: when PHP tries to execute git in the line from the error message, it can’t find the git binary). You should check this with your hosting provider.
Are you sure the server has a valid SSH key? Maybe via cmd line only your user has a key. Oftentimes the webserver runs with its own user (apache normally uses the user www-data). Having apache run with “your user” actually requires some extra configurations (like setting up suEXEC) that many (less serious) shared hosting providers don’t do.
Thanks @lukasbestle and @rasteiner for your suggestions. That has definitely moved me along. I’m going to detail a few steps here for anyone future-googling:
Yes, apache was using the www-data user. You can duplicate your ‘actual’ user key for use as that user too: http://stackoverflow.com/a/7307059/2989133
I also needed to connect via the command line first to acknowledge the message and add github to known hosts:
$sudo -u www-data ssh -vT email@example.com
I checked php had access to git path by comparing $which git to output of phpinfo(). And to prove it, made a php page of <?php echo exec("git status"); which should now output a message like ‘no changes added to commit’.
Although sadly enabling Autogit plugin still errors at the same place. I might try running apache as me instead, see if hat helps.
My conclusion is, it is better to run apache as [the user that I use to ssh into the server] rather than www-data.
Given that it is likely that you will be using this user for the initial git init anyway, and possibly other actions, it simplifies permissions, keys, etc. And, autogit seems much happier this way!
I would love a version where I don’t have to have a remote repository but could simply commit to the repository within the content folder. This way I could easily just pull changes to my local repository I made with the panel without committing them on my remote via ssh before pulling. I don’t want an extra remote repository. Or do I miss something here?