Thanks for your tips.

I just wanted to block anyone to commit on master branch.

So I just checked the branch and if I found it to be master branch
then I removed the commit with 'git reset --hard HEAD^' in the post-
commit hook.

Regards,
Tuhin Mohanta
On May 31, 8:53 pm, Sitaram Chamarty <[email protected]> wrote:
> sorry; lost the previous message and responding to a response instead...
>
> yes, you need a hook.  I suggest the pre-receive hook, and it can be
> something like this (untested):
>
> ----------------------
> #!/bin/sh
>
> grep -q refs/heads/master$ && exit 1
> exit 0
> ----------------------
>
> make it executable and you're all set...
>
>
>
> On Fri, May 29, 2009 at 10:53 PM, Glenn Rempe <[email protected]> wrote:
>
> > If I understand correctly what you are trying to do...
>
> > Git does not manage access control generally.  It delegates this to
> > the access methods available (e.g. unix file permissions, ssh login
> > keys, etc).  You might be able to implement what you are trying to do
> > with a hook, but it may not be foolproof.
>
> > You could implement a different way on github (or other git hosting)
> > by creating an original repo (the one you own, and only you have write
> > access to), and then having each developer fork that master repo.
>
> > They do their work on the local fork, push their commits to their
> > forked repo on github, issue you a pull request, and then you just
> > cherry pick those commits you want on your master which only you have
> > write access to (Using the 'Fork Queue' on GitHub).  This gives you
> > effective total control of what ends up on YOUR master branch.  Which
> > you can consider the project master.
>
> > Cheers,
>
> > Glenn
>
> > On May 29, 2:39 am, Tuhin Mohanta <[email protected]> wrote:
> > > Hi All,
>
> > > I would like to restrict developers from merging to master brach from
> > their
> > > development branches, whats the best possible to way to implement it?
> > Should
> > > I use some hook?  should I restrict them from making any commit on the
> > > master branch?
> > > Please suggest me the best possible approach.
> > > Thanks in advance.
>
> > > --Tuhin- Hide quoted text -
>
> - Show quoted text -
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"GitHub" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/github?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to