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

前端 未结 14 1293
庸人自扰
庸人自扰 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 16:51

    This is an old question, but this may help Mac users.

    If you are copying files from Time Machine manually, instead of restoring them through Time Machine, it'll add ACLs to everything, which can mess up your permissions.

    For example, the section in this article that says "How to Fix Mac OS X File Permissions" shows that "everyone" has custom permissions, which messes it all up:

    You need to remove the ACLs from those directories/files. This Super User answer goes into it, but here's the command:

    sudo chmod -RN .

    Then you can make sure your directories and files have the proper permissions. I use 750 for directories and 644 for files.

提交回复
热议问题