Konstantin Khomoutov, great explanation. Now everything is clear, thank you.

On Tuesday, 28 June 2016 16:28:09 UTC+2, Konstantin Khomoutov wrote:
>
> On Tue, 28 Jun 2016 06:46:13 -0700 (PDT) 
> Michał Urban <motivapr...@gmail.com <javascript:>> wrote: 
>
> > Oh, gosh - I've made a mistake in my question, I meant he should be 
> > capable of doing git *PUSH*. When I limit his write permission he 
> > can't do it, but... when he has a write privileges - he is able to 
> > delete whole repository... 
>
> That's perfectly expected when you think about it a bit more: when a 
> Git repository is located on a network share it's not really remote but 
> is rather local -- just stored on "remote filesystem".  Consequently, 
> no matter what sort of operation is done on that repository, it's always 
> done using a Git instance running locally on the machine of whoever is 
> doing that operation, and to do push, that instance obviously needs 
> full permissions on the repository -- to actually update its object 
> store with the new data, update refs (branch pointers etc). 
>
> The only way to solve this is to serve access to the repo using Git 
> instance which runs on your machine not your coworker's, and this means 
> not using network share in the first place. 
>
> Unfortunately, Git does not have an easy-peasy analog to `hg serve` 
> or `fossil serve`, so if you don't want to mess with setting up an SSH 
> server or host Git via IIS, you can resort to using the so-called Git 
> daemon.  It's used to serve access to repositories when the git:// 
> scheme is used in an URI of a remote repository, and since it does not 
> provide any sort of authentication and authorization, it's typically 
> used for R/O access.  But if it's OK for you, you can tell it to allow 
> write access (to anyone able to connect to it via your local network). 
>
> To allow anonymous pushing, run `git daemon` with 
> the "--enable=receive-pack" command-line option (new Git versions 
> should also support repository's configuration variable 
> "daemon.receivepack"). 
>
> [...] 
> > > I've got remote repository on my network share. 
> > > 
> > > I need to add permission to write for my workmate, so he can 
> > > execute git pull, but... now he can delete whole my .git folder 
> > > (from Explorer/cmd, etc.). I would like to limit his privileges to 
> > > I guess... pushing. How to achieve that? 
> [...] 
>

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to