Question

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') ?

Était-ce utile?

La solution

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).

Autres conseils

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
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top