We need to allow developers:

1) to create topic branches and save them at remote repo.

2) Do changes.

3) Do merge to 'development' branch.

4) Remove topic branch (git push origin :TestRemoteBranch).

But we would rather forbid to use non fast forward merges with usage RW permission. But this permission also forbid to to delete topic branches.

Is there any way to avoid non fast forward merges and allow to remove topic branches (not a 'development' and 'master') ?

有帮助吗?

解决方案

When you have to do checks that the core gitolite cannot do, it is time to bring in the VREF:

For every refex starting with VREF/FOO/ in a rule that applies to this user, a call to a program called FOO is triggered (location here).

So in your program 'FOO', you can check if the push is a non-fast-forward one (denied) or if it is a branch deletion (allowed).

其他提示

I resolved this by gitolite v2 (as disabling rewind on main branches - master and development):

repo    file-formats
        RW  master      = @all
        -   master      = @all
        RW  development = @all
        -   development = @all
        RW+             = @all
        config gitolite-options.deny-repo = 1
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top