I have my apache2 webserver directory as a Git directory, so when me and my team members (school project) make changes to our GitHub folder, it can easily be pulled by running 'git pull' in putty.
I want to make this automatic (using a WebHook) by having a "pull.php" file that has "<?php exec("git pull"); <?" inside it.
However, the user that shows up when I run whoami function in php is "www-data".
In order to allow www-data to run git pull without having to enter credentials (I tried setting up SSH and it refused to work), I need to allow them to store credentials.
This is problematic because unlike other users, www-data has no directory in /home/accountname to save its .gitconfig to.
How do I go about having "git credential.helper store" work for www-data?
I would also not mind having SSH, but I run into the same problem where the default directory to save the id_rsa file to says no permission/does not exist, so I would prefer the previous question to be answered.
EDIT: In the end it was a variety of problems. it was trying to pull using HTTPS because i cloned it using HTTPS. long story short, i ended up deleting the repo and recloning it with SSH and all of my problems went away. There were a lot of steps in between but anyone with a similar problem can just do that and skip the headache haha.