git-deploy icon indicating copy to clipboard operation
git-deploy copied to clipboard

Pull failed - permission denied

Open mlingelbach opened this issue 5 years ago • 2 comments

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?

mlingelbach avatar Oct 19 '19 10:10 mlingelbach

have you solve this problem ?

rafmaghari avatar Feb 25 '20 09:02 rafmaghari

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

Smartay avatar Jan 31 '21 00:01 Smartay