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

Re: Git newbie question: permissions

From
ESEd Schofield <edschofield@gmail.com>
Date
Oct 9, 2008, 22:59 UTC
Message-ID
<1b5a37350810091559y151e244t43710d4e4c3dabcf@mail.gmail.com>
In-Reply-To
<2008-10-09-23-41-14+trackit+sam@rfc1149.net>
On Thu, Oct 9, 2008 at 10:41 PM, Samuel Tardieu <sam@rfc1149.net> wrote:
Show 25 quoted lines
>>>>>> "Ed" == Ed Schofield <edschofield@gmail.com> writes:
>
> Ed> I have now run "git --bare init --shared=group" to reinitialize
> Ed> the repository. This seems to have changed the directories to be
> Ed> g+sx. (Is this all it did?). There are still some objects
> Ed> directories with 755 permissions rather than 770, which I presume
> Ed> I want, and the group ownership of these is wrong. Shall I change
> Ed> these by hand? The sha1 files all have 444 permissions; is this
> Ed> right?
>
> Ed> The last question I have is how to ensure that git creates object
> Ed> files etc. with the right permissions when users push in future.
>
> As Marc said, you should first make sure that "config" contains
> "sharedrepository = 1" in the "[core]" section.
>
> Then you can do the following:
>
>  - remove all permissions for "others":  chmod -R o-rwx .
>  - mirror "user" permissions to "group": chmod -R g=u .
>  - add +s flag to directories:           find . -type d | xargs chmod g+s
>
> This should fix your current situation. The "sharedrepository = 1"
> will tell git to maintain a proper shared state in the future
> on objects it creates (i.e. mirror "user" permission to "group" ones).
This worked beautifully. Thanks Sam, thanks Marc!
-- Ed
Previous: Samuel TardieuNext: Samuel Lucas Vaz de Mello
Message 5 of 6 in “Git newbie question: permissions”
  1. Ed SchofieldOct 9, 2008
  2. Samuel Lucas Vaz de MelloOct 9, 2008
  3. Marc WeberOct 9, 2008
  4. Samuel TardieuOct 9, 2008
  5. Ed SchofieldOct 9, 2008
  6. Samuel Lucas Vaz de MelloOct 10, 2008

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.