I have a php project on my local machine and want to push it to my staging server. Therefore I setup the git repository on the staging server. In PHPStorm I now want to push:
git push mfstaging master
I get the error:
remote: fatal: Unable to create temporary file '/var/www/mfserver.git/./objects/pack/tmp_pack_XXXXXX': Permission denied
Where do I need to make a change? the user on my digital ocean instance is admin and with this user I created the git repo. How do I know push from my local machine to this?
dont do sudo git push
. If youve set it up properly, then your local user will have an ssh key that the root of his machine shouldnt have, which means that pushing as root shouldnt authenticate.
You need to make sure that your repository directory is writeable by the git user itself. (you did make one right?).
Heres a good resource to help you clean things up.