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

Re: Regression bug with latest SAFE ownership patch

From
CSColin Stagner <ask+git@howdoi.land>
Date
Aug 18, 2024, 17:30 UTC
Message-ID
<fe20f819-5b8e-4cca-a094-24e5d4333aa6@howdoi.land>
In-Reply-To
<CADCaTgpcmMbLoKR-rWf_roWfbgWJL6HuURDxwovvKQA8syf=vw@mail.gmail.com>
On 8/16/24 22:15, James wrote:
> I have a git repo which is on a shared server that I trust and control. Adding a safe.directory does _not_ allow me to use this repo anymore.
> james@computer1:~/whatever$ git remote show server2
> [remote "server2"]
>      url = ssh://root@server2:/home/someoneelse/whatever/
>      fetch = +refs/heads/*:refs/remotes/server2/*

I believe that safe.directory only affects repositories hosted on the local filesystem—and not on SSH or HTTP(S) remotes.

I would discourage cloning a user repository with the root user, or running git as root if you can at all avoid it.

Since you already have root access on this system, how difficult would it be to add your SSH key as an authorized_key for someoneelse? Then you could use ssh://someoneelse@server2:/home/someoneelse/whatever/.git as your remote.

You could also share repositories via a simple gatekeeper or forge, like gitolite.

Colin
Previous: brian m. carlson
Message 3 of 3 in “Regression bug with latest SAFE ownership patch”
  1. JamesAug 17, 2024
  2. brian m. carlsonAug 17, 2024
  3. Colin StagnerAug 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.