git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: disable branch modification

From
Andreas Ericsson <ae@op5.se>
Date
Aug 4, 2009, 13:36 UTC
Message-ID
<4A78396B.70004@op5.se>
In-Reply-To
<24550469.post@talk.nabble.com>
Ishaaq Chandy wrote:
Show 13 quoted lines
> Hi all,
> I've got a remote git repository that I want multiple users to be able to
> push to. This is all set up fine and working beautifully. The only thing is,
> I want to be able to lock down the branches on this remote repo, once set up
> users should not be able to:
> 
> 1. Create new branches on it
> 2. Delete existing branches from it
> 3. push non-fast-forward commits to it.
> 
> I think I'll need to write a pre-receive hook for this, but before I embark
> on this, any helpful pointers would be appreciated.
> 

I did this once so that users could only push to branches in a namespace beginning with their username, so the user "hgb" could only write to "hgb/master" and never to "master" directly (for example). This provides maximum freedom to the users while making sure they never muck about with any "official" branches.

The script to accomplish this is, alas, lost.

Denying non-fast-forwards even if --force is in effect is a config option these days, I think.

-- 
Andreas Ericsson                   andreas.ericsson@op5.se
OP5 AB                             www.op5.se
Tel: +46 8-230225                  Fax: +46 8-230231

Considering the successes of the wars on alcohol, poverty, drugs and
terror, I think we should give some serious thought to declaring war
on peace.
Previous: Ishaaq ChandyNext: Alex Riesen
Message 2 of 3 in “disable branch modification”
  1. Ishaaq ChandyJul 18, 2009
  2. Andreas EricssonAug 4, 2009
  3. Alex RiesenAug 4, 2009

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.