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

Re: Folder level Acces in git

From
MBMagnus Bäck <magnus.back@sonyericsson.com>
Date
Nov 3, 2011, 07:17 UTC
Message-ID
<20111103071701.GA22412@jpl.local>
In-Reply-To
<1320300655224-6958047.post@n2.nabble.com>
On Thursday, November 03, 2011 at 07:10 CET,
     redhat1981 <redhat1981@gmail.com> wrote:
Show 19 quoted lines
> I am using Gitosis, Adding the gitosis conf file
> 
> [group testabc]
> writable = testabc
> members =   shrii Abhijeet premkumar
> add cgit = yes
> gitweb = yes
> 
> 
> [group testabc-readonly]
> readonly = testabc
> members =  Ganesh Shweta
> add cgit = yes
> gitweb = yes
> 
> Inside the repository, testabc let us say there are folders folder1,
> folder 2 etc, I want some users to have read/write, read or no access
> to the folder1 or folder2, Is this possible in Git, I have done it in
> SVN, Please help!!

Given Git's nature, you can't have read access restrictions on a sub-git level (i.e. file/directory level). For basically the same reason, you can never prevent users from making (local) commits that modify certain paths (but you can encourage people to have local hooks to enforce such policies). What you *can* do is install a server-side update hook that rejects attempts to push commits that modify certain paths. If you're willing to trade Gitosis for Gitolite, you get that feature for free.

http://book.git-scm.com/5_git_hooks.html http://progit.org/book/ch4-8.html

-- 
Magnus Bäck                   Opinions are my own and do not necessarily
SW Configuration Manager      represent the ones of my employer, etc.
Sony Ericsson
Previous: redhat1981Next: Jens Lehmann
Message 2 of 7 in “Folder level Acces in git”
  1. redhat1981Nov 3, 2011
  2. Magnus BäckNov 3, 2011
  3. Jens LehmannNov 3, 2011
  4. Eugene SajineNov 3, 2011
  5. Joshua JensenNov 4, 2011
  6. Jens LehmannNov 4, 2011
  7. Eugene SajineNov 4, 2011

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.