I have a GIT repository foo
with 2 branches: branch1
and branch2
. I want to set up a gitolite rule that denies pushing modifications for this
file only for branch1
for bar
user. This is what I've tried so far:
repo foo
- branch1/this = bar
repo foo
- branch1/NAME/this = bar
repo foo
- branch1 /NAME/this = bar
I don't even know if this is possible with gitolite.
Any help very much welcome. Thanks in advance.
EDIT: I tried this 2 configurations as suggested. The following:
- branch1 VREF/NAME/this = bar
RW branch2 VREF/NAME/this = @all
rejects both branches
remote: FATAL: W VREF/NAME/this testing bar DENIED by VREF/NAME/this
remote: error: hook declined to update refs/heads/branch2
remote: FATAL: W VREF/NAME/this testing bar DENIED by VREF/NAME/this
remote: error: hook declined to update refs/heads/branch1
To debian:testing.git
! [remote rejected] branch2 -> branch2 (hook declined)
! [remote rejected] branch1 -> branch1 (hook declined)
error: failed to push some refs to 'debian:testing.git'
While the following
RW branch2 VREF/NAME/this = @all
- branch1 VREF/NAME/this = bar
allows both branches to be pushed
To debian:testing.git
f6bc01d..09b63ab branch2 -> branch2
7a868cf..09bcb63 branch1 -> branch1
Using the same branch (branch1
)
RW branch1 VREF/NAME/this = @all
- branch1 VREF/NAME/this = bar
To debian:testing.git
9c50fc4..02f350d branch1 -> branch1
- branch1 VREF/NAME/this = bar
RW branch1 VREF/NAME/this = @all
remote: FATAL: W VREF/NAME/this testing bar DENIED by VREF/NAME/this
remote: error: hook declined to update refs/heads/branch1
To debian:testing.git
! [remote rejected] branch1 -> branch1 (hook declined)