Categories
allPost

windows subsystem for linux – How to correct `git` reporting `detected dubious ownership in repository` without adding `safe.directory` when using WSL?

3 people 👁️ing this randomly

Try Adsterra Earnings, it’s 100% Authentic to make money more and more.

Try Adsterra Earnings, it’s 100% Authentic to make money more and more.

I used git for the last few years in this context:

  • Host = my laptop, windows.
  • WSL enabled
  • Repos live in the Linux side.
  • I access them both from the Linux and the Windows side.

I can access the files in Linux either via git-bash like this (via the //wsl$/ share):

Access linxux from git bash

Or natively in the WSL bash terminal:

Access Linux from wsl bash

Those accesses go to the very same directory.

Now it happens that if I do git status inside a repo from the windows side it gives the error fatal: detected dubious ownership in repository at:

error in git-bash

While in the WSL-Linux it does not, for the same directory:

no error in wsl-bash

It did not happen before. I’ve been using this setup for years. This started happening 2 days ago.

In fact, I installed a newer version of git-bash 2 days ago and I suspect the bash environment could condition this.

I work with about 100 repos, and I have found to fail in all of them which I’ve tried (about 10 repos). Expectedly it’ll happen to those 100 repos.

None of those previously-working now-failing repos have been touched, so neither users, neither permissions have changed.

So mutating from “well” to “bad” is not in the filesystem side, must be in the git-bash side.

I don’t want to just white-list it with safe.directory. I want to understand what’s going on behind the scenes. Why it happens today and not 3 days ago. I want to know “what does git expect” and see how can I correct it.

The users seem correct. From the linux side:

linux ids

And from the windows side it also matches the hard disk and the id:

windows ids

How can I tell the ownership that is expected by git for it to do not complain?

Source

Dillard's - The Style of Your Life.

By allaboutian

open profile for all

Related Posts

kardolus/chatgpt-cli: ChatGPT CLI is a versatile tool for interacting with LLM models through OpenAI and Azure, as well as models from Perplexity AI and Llama. It supports prompts and history tracking for seamless, context-aware interactions. With extensive configuration options, it’s designed for both users and developers to create a customized GPT experience.

21 people 👁️ing this randomly Try Adsterra Earnings, it’s 100% Authentic to make money more…

AdmTal/chat-gpt-games: Prompts for playable games in ChatGPT

23 people 👁️ing this randomly Try Adsterra Earnings, it’s 100% Authentic to make money more…

urbaninfolab/ComputeGPT: ComputeGPT is a free and accurate chat model and calculator for math, science, and engineering. It’s also known as MathGPT and ScienceGPT, and can compute most numerical answers.

21 people 👁️ing this randomly Try Adsterra Earnings, it’s 100% Authentic to make money more…