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

Shared bare repository dubious ownership error after 2.40.1-r0

From
MLMike Lodispoto <mike@lodispoto.com>
Date
Jul 10, 2024, 23:16 UTC
Message-ID
<dd703bdc-f485-4162-92a5-fd2828b69604@lodispoto.com>
Hello,

I use bare shared repositories on Alpine Edge, which have been working perfectly until I updated git recently (from 2.38.5-r0 to 2.45.2-r1).

My setup is a git user which owns all repositories (/home/git/*.git). Each repository has a group, so the ownership is git:projectname. The group has the same permissions as the user (-rw-rw----)

To give access to the repository, I have a user set up for the developer, and then I add them to the group. Each repository was initialized with 'git init --bare --shared'. In the config file, 'sharedrepository = 1' is set under [core].

My issue is that somewhere between 2.40.1-r0 and 2.43.4-r0 on the server, I start getting the following error on the server with a user in the group, and remotely (tried with client version 2.39.2 and 2.45.2) through a user in the group:

| $ git pull
| fatal: detected dubious ownership in repository at '/home/git/project.git'
| To add an exception for this directory, call:
|
|         git config --global --add safe.directory /home/git/project.git
| fatal: Could not read from remote repository.
|
| Please make sure you have the correct access rights
| and the repository exists.
When using git 2.40.1-r0 or below, it all works and I get this:
| $ git pull
| Already up to date.

Is there a breaking change I missed that I need to change my configuration for?

Thank you,
Michael Lodispoto
Next: Colin Stagner
Message 1 of 3 in “Shared bare repository dubious ownership error after 2.40.1-r0”
  1. Mike LodispotoJul 10, 2024
  2. Colin StagnerJul 18, 2024
  3. Ben ZaninJul 18, 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.