Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix git's detected dubious ownership in repository warning #186

Closed
lsorber opened this issue Apr 15, 2023 · 1 comment · Fixed by #242
Closed

Fix git's detected dubious ownership in repository warning #186

lsorber opened this issue Apr 15, 2023 · 1 comment · Fixed by #242
Assignees
Labels
bug Something isn't working

Comments

@lsorber
Copy link
Member

lsorber commented Apr 15, 2023

Problem description and solution: https://www.kenmuse.com/blog/avoiding-dubious-ownership-in-dev-containers/

@lsorber lsorber added the bug Something isn't working label Apr 15, 2023
@lsorber lsorber self-assigned this Apr 15, 2023
@lukin0110
Copy link

I'd add this somewhere in the Dockerfile instead of in the devcontainer.json and use system instead of global:

RUN  git config --system --add safe.directory '*'

Reasons:

  • Adding it to the Dockerfile will solve the issue in a central place. It will also solve the same issue when the image is used on linux outside a devcontainer/VSCode/codespaces context. Eg: docker compose run dev
  • Using system will add the config to /etc/gitconfig. In case global is used it will be added to ~/.gitconfig. But this will make VSCode fail to share gitconfig / credentials.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants