{"thread":{"id":"20155","subject":"disable branch modification","startedAt":"2009-07-18T18:16:13Z","lastAt":"2009-08-04T16:50:51Z","messageCount":3,"participants":["Ishaaq Chandy","Andreas Ericsson","Alex Riesen"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"118241","messageId":"24550469.post@talk.nabble.com","threadId":"20155","inReplyTo":null,"subject":"disable branch modification","fromName":"Ishaaq Chandy","fromEmail":"ishaaq@gmail.com","sentAt":"2009-07-18T18:16:13Z","receivedAt":"2009-07-18T18:16:13Z","isPatch":false,"sender":{"key":"ishaaq@gmail.com","avatar":null},"body":"\nHi all,\nI've got a remote git repository that I want multiple users to be able to\npush to. This is all set up fine and working beautifully. The only thing is,\nI want to be able to lock down the branches on this remote repo, once set up\nusers should not be able to:\n\n1. Create new branches on it\n2. Delete existing branches from it\n3. push non-fast-forward commits to it.\n\nI think I'll need to write a pre-receive hook for this, but before I embark\non this, any helpful pointers would be appreciated.\n\nThanks,\nIshaaq\n-- \nView this message in context: http://www.nabble.com/disable-branch-modification-tp24550469p24550469.html\nSent from the git mailing list archive at Nabble.com.\n"},{"id":"119497","messageId":"4A78396B.70004@op5.se","threadId":"20155","inReplyTo":"24550469.post@talk.nabble.com","subject":"Re: disable branch modification","fromName":"Andreas Ericsson","fromEmail":"ae@op5.se","sentAt":"2009-08-04T13:36:43Z","receivedAt":"2009-08-04T13:36:43Z","isPatch":false,"sender":{"key":"ae@op5.se","avatar":"https://gravatar.com/avatar/426e89595c75a8f5252dd0c989e5fabe5bcac616e68557427ad9aef6b0ca342a?d=mp&s=160"},"body":"Ishaaq Chandy wrote:\n> Hi all,\n> I've got a remote git repository that I want multiple users to be able to\n> push to. This is all set up fine and working beautifully. The only thing is,\n> I want to be able to lock down the branches on this remote repo, once set up\n> users should not be able to:\n> \n> 1. Create new branches on it\n> 2. Delete existing branches from it\n> 3. push non-fast-forward commits to it.\n> \n> I think I'll need to write a pre-receive hook for this, but before I embark\n> on this, any helpful pointers would be appreciated.\n> \n\nI did this once so that users could only push to branches in a namespace\nbeginning with their username, so the user \"hgb\" could only write to\n\"hgb/master\" and never to \"master\" directly (for example). This provides\nmaximum freedom to the users while making sure they never muck about with\nany \"official\" branches.\n\nThe script to accomplish this is, alas, lost.\n\nDenying non-fast-forwards even if --force is in effect is a config option\nthese days, I think.\n\n-- \nAndreas Ericsson                   andreas.ericsson@op5.se\nOP5 AB                             www.op5.se\nTel: +46 8-230225                  Fax: +46 8-230231\n\nConsidering the successes of the wars on alcohol, poverty, drugs and\nterror, I think we should give some serious thought to declaring war\non peace.\n"},{"id":"119503","messageId":"81b0412b0908040950j1aa8ca04t68061a79c96f6522@mail.gmail.com","threadId":"20155","inReplyTo":"24550469.post@talk.nabble.com","subject":"Re: disable branch modification","fromName":"Alex Riesen","fromEmail":"raa.lkml@gmail.com","sentAt":"2009-08-04T16:50:51Z","receivedAt":"2009-08-04T16:50:51Z","isPatch":false,"sender":{"key":"raa.lkml@gmail.com","avatar":"https://avatars.githubusercontent.com/u/324101?v=4"},"body":"On Sat, Jul 18, 2009 at 20:16, Ishaaq Chandy<ishaaq@gmail.com> wrote:\n> 1. Create new branches on it\n> 2. Delete existing branches from it\n\nYou cannot have these.\n\n> 3. push non-fast-forward commits to it.\n>\n> I think I'll need to write a pre-receive hook for this, but before I embark\n> on this, any helpful pointers would be appreciated.\n\nLook in the mailing list archives for pre-receive, update and SSH,\nthere were some good examples of update and pre-receive posted.\nAlso, there is contrib/hooks/update-paranoid in Git repo. It\nimplements an ACL per SSH user.\n"}]}