deploying a website/webapp via git/gitolite permissions error

前端 未结 1 1582
眼角桃花
眼角桃花 2020-12-10 23:32

I\'ve setup a development/testing server where developers can push repositories to a remote repo/webserver via gitolite/git. On the repository site everything works well and

相关标签:
1条回答
  • 2020-12-10 23:52

    First, make sure the git account is in the same group than the apache account.
    (Or you need to go back to my previous answer that you want to avoid)

    You report this works:

     sudo GIT_WORK_TREE=..... git checkout -f
    

    But with a bare repo, you could also see get:

     fatal: You are on a branch yet to be born
    

    (I wouldn't recommend trying to make your gitolite-managed bare repo a non-bare one as in this blog post

    git config core.worktree /home/user/myproject
    git config core.bare false
    git config receive.denycurrentbranch ignore
    

    )

    I prefer making sure /var/www/www.example.com directory is a git repo, in which you can pull, instead of trying to checkout.
    So the hook I like is more:

    cd /var/www/www.example.com
    git --git-dir=/var/www/www.example.com/.git --git-work-tree=/var/www/www.example.com pull
    

    (with origin, the remote name which is used by default by git pull, refering to the gitolite bare repo)

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