Gitolite 发布大师到 /var/www/html/repositoryname?

Gitolite release master to /var/www/html/repositoryname?

有什么方法可以自动释放当前主and/or分支到/var/www/html/repositoryname与gitolite?

我试过设置符号链接,但意识到 gitolite 存储库将文件打包,但 .git 目录除外。

创建 post 钩子是针对此类问题的一种建议解决方案,但我找不到适合我的案例的应用程序。

Creating post hooks was one suggested solution for this kind of problem but I was not able to find a suitable application for my case.

是的,post-receive 钩子是推荐的解决方案。
例如参见“GIT post-receive checkout without root folder

除此之外,使用 gitolite,您现在有一个 repo specific hook
参见“repo-specific hooks

add this line in the rc file, within the %RC block, if it's not already present, or uncomment it if it's already present and commented out:

LOCAL_CODE => "$rc{GL_ADMIN_BASE}/local",

uncomment the 'repo-specific-hooks' line in the rc file or add it to the ENABLE list if it doesn't exist.

If your rc file does not have an ENABLE list, you need to add this to the POST_COMPILE and the POST_CREATE lists.
Click here for more on all this.

put your hooks into your gitolite-admin clone, as follows:

# on your workstation
cd /path/to/your/gitolite-admin-clone
mkdir -p local/hooks/repo-specific

Now add your hooks to that directory, but instead of using the git "standard" names (pre-receive, post-receive, post-update), you use descriptive names (e.g. "deploy", "RSS-post", etc).

add them to the repos you want them to be active in, in your conf file. For example:

repo foo
    option hook.post-update     =   jenkins
repo bar @baz
    option hook.post-update     =   deploy RSS-post

add, commit, and push the admin repo.