Using git below web root in production

后端 未结 3 1160
梦毁少年i
梦毁少年i 2020-12-18 11:26

I\'m an avid git user; I use git in development; in staging, but not in production.

Are there any good reasons not to use git below the web root (/var/www/) in a pr

3条回答
  •  無奈伤痛
    2020-12-18 12:11

    Apart from the obvious aesthetic reason, permissions can often be a problem when you have a repository in /var/www.

    On my production server, I have a bare repository in a private directory on branch production and a detached worktree in /var/www (see the core.worktree setting). Additionally, I have a post-receive hook to run git checkout -f, so all I have to do from my local computer is push to the production branch, and the rest is automatically taken care of.

提交回复
热议问题