Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to prevent users from deleting commit from remote git repository

Tags:

git

gitolite

I have a git remote repository setup on a shared hosting service with access to git over https. I want to prevent some or all developers from deleting commits from remote repository. How can I achieve this?

like image 307
Divick Avatar asked Mar 01 '26 21:03

Divick


1 Answers

With gitolite specifically, you have different types of permissions.
They include a 'D' for deletion:

repo @all
    RWCD dummy-branch = foo

That will authorize the deletion of a branch dummy-branch, but that will also make all your existing RW+ rule deny deletion (because they don't have a 'D')

If a rule specifies RWD or RW+D, then rules that do NOT have the D qualifier will no longer permit deleting a ref.

In that case, you specify who has the right to delete, the others, by default, won't have that right.

like image 140
VonC Avatar answered Mar 04 '26 12:03

VonC