Git push error: Unable to unlink old (Permission denied)

前端 未结 14 1159
庸人自扰
庸人自扰 2020-11-29 16:32

In the remote server I have a post-receive hook set up in order to make a git checkout of my repository:

#!/bin/sh
GIT_WORK_TREE=/var/www/ git         


        
相关标签:
14条回答
  • 2020-11-29 17:13

    Also remember to check permission of root directory itself!

    You may find:

    drwxr-xr-x  9 not-you www-data  4096 Aug  8 16:36 ./
    -rw-r--r--  1     you www-data  3012 Aug  8 16:36 README.txt
    -rw-r--r--  1     you www-data  3012 Aug  8 16:36 UPDATE.txt
    

    and 'permission denied' error will pop up.

    0 讨论(0)
  • 2020-11-29 17:18

    After checking the permission of the folder, it is okay with 744. I had the problem with a plugin that is installed on my WordPress site. The plugin has hooked that are in the corn job I suspected.

    With a simple sudo it can fix the issue

    sudo git pull origin master
    

    You have it working.

    0 讨论(0)
提交回复
热议问题