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

Re: git gc changes ownerships of files linux

From
brian m. carlson <sandals@crustytoothpaste.net>
Date
Feb 11, 2024, 15:28 UTC
Message-ID
<ZcjnuSAZiNHvA5h1@tapette.crustytoothpaste.net>
In-Reply-To
<20240211151455.GA27103@tb-raspi4>
On 2024-02-11 at 15:14:55, Torsten Bögershausen wrote:
Show 11 quoted lines
> Thanks for reporting this -
> I think that you have a working workaround ?
> 
> However, Git has a feature called "shared repository".
> You need to define a (unix) group that is shared between
> your user(s) and the ansible user.
> 
> The basic trick is to do
> git config core.sharedRepository true
> 
> (And then change the ownership of all files/directories to the new group)

On Linux, you also should set each directory to be setgid. That's because by default, Linux uses the user's current group ID as the group to create new directories. However, you'll want the group to be inherited from the parent directory, which is the behaviour when the parent directory is setgid.

This behaviour is the default on the BSDs, and no such configuration is required there.

-- 
brian m. carlson (he/him or they/them)
Toronto, Ontario, CA
Previous: Torsten BögershausenNext: Torsten Bögershausen
Message 3 of 8 in “git gc changes ownerships of files linux”
  1. K_VFeb 10, 2024
  2. Torsten BögershausenFeb 11, 2024
  3. brian m. carlsonFeb 11, 2024
  4. Torsten BögershausenFeb 11, 2024
  5. Junio C HamanoFeb 11, 2024
  6. Torsten BögershausenFeb 11, 2024
  7. brian m. carlsonFeb 11, 2024
  8. rsbecker@nexbridge.comFeb 11, 2024

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.