vicenteguerra / git-deploy

Php Script for Auto-Pull in server (Using WebHook from GitLab, GitHub and Bitbucket)
641 stars 236 forks source link

Pull failed - permission denied #37

Open mlingelbach opened 5 years ago

mlingelbach commented 5 years ago

Hi,

I am getting this error, when call "git pull" from script:

=== ERROR: Pull failed using GIT /usr/bin/git and DIR /home/****/public_html/test.****.de/ === Permission denied (publickey). fatal: Could not read from remote repository.

But when I execute "git pull" via ssh console, I dont get this error and the pull will execute.

I checked the user calling the script. It's the same user I'm signed in with via ssh.

Has anyone an idea?

rafmaghari commented 4 years ago

have you solve this problem ?

Smartay commented 3 years ago

Open a terminal window and cd to the repository dir then run (Hidden files are not included in the original change to update the repo dir) Also confirm the SSH key has been added into the git provider of choice e.g. gitlab > user > SSH Keys sudo chown -R www-data:www-data .git sudo chmod -R g+s .git sudo chmod -R 775 .git Also as a side not just incase you could also try sudo service ssh restart