How to prevent users from deleting commit from remote git repository

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?

  • Git and SVN, parallel
  • using Git and pushing to production mode (w/ diagram)
  • Unable to load the Rcpp Package in Windows Server 2008
  • Deploying site with Git: post-update hook works first time, then never again
  • Git branching: easily merging a third branch into two conflicting branches
  • Storing git config as part of the repository
  • Git Folder deleted, but not gone
  • I've changed my branching system. How can I sort it out on github?
  • Installing Git-TFS without Git itself
  • Fork one directory on github
  • git checkout tries to checkout commit rather than branch
  • What is the difference between . and * in “git add”?
  • One Solution collect form web for “How to prevent users from deleting commit from remote git repository”

    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.

    Git Baby is a git and github fan, let's start git clone.