Git development
 help / color / mirror / Atom feed
From: "Björn Steinbrink" <B.Steinbrink@gmx.de>
To: Mohit Aron <mohit.aron@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: denying branch creation in a shared repository
Date: Mon, 19 Oct 2009 10:51:16 +0200	[thread overview]
Message-ID: <20091019085116.GB2796@atjola.homenet> (raw)
In-Reply-To: <ee22b09e0910190132u20931fb4i6a98fb87582a9e56@mail.gmail.com>

On 2009.10.19 01:32:24 -0700, Mohit Aron wrote:
> I'm setting up a shared repository and I'd like to prevent users from
> creating branches in it (they can of course create local branches in
> their own clone of this repository). How can I accomplish this ? I
> looked at 'git help config' and it seems I need something similar to
> the parameter receive.denyDeletes - this prevents deletion of
> branches.

You could write a pre-receive or update hook (depending on whether you
want the whole push to fail, or just the branch head creation, see
githooks(5)).

If a ref is created, the old value is 40 0 (just zeros, forty of them).
And if the refname starts with refs/heads/, then a branch head is being
created. And in that case, you could refuse the push.

Björn

  parent reply	other threads:[~2009-10-19  8:51 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-10-19  8:32 denying branch creation in a shared repository Mohit Aron
2009-10-19  8:43 ` Sitaram Chamarty
2009-10-19 16:43   ` Mohit Aron
2009-10-20 11:24     ` Sitaram Chamarty
2009-10-19  8:51 ` Björn Steinbrink [this message]
2009-10-19  9:57 ` Johannes Schindelin
2009-10-19 10:08   ` Howard Miller
2009-10-19 12:00     ` Johannes Schindelin
2009-10-19 12:19       ` Howard Miller
2009-10-19 12:20         ` Howard Miller
2009-10-19 12:59         ` Thomas Rast
2009-10-19 13:12           ` Howard Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20091019085116.GB2796@atjola.homenet \
    --to=b.steinbrink@gmx.de \
    --cc=git@vger.kernel.org \
    --cc=mohit.aron@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox