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

fatal: detected dubious ownership in repository at '/git' #54

Closed
josejsarmento opened this issue Nov 24, 2022 · 3 comments
Closed

fatal: detected dubious ownership in repository at '/git' #54

josejsarmento opened this issue Nov 24, 2022 · 3 comments

Comments

@josejsarmento
Copy link

In a local git repo, I enter:

docker run -ti --rm -v ${HOME}:/root -v $(pwd):/git alpine/git status

and it gives me the following error:

docker run -ti --rm -v ${HOME}:/root -v $(pwd):/git alpine/git status
fatal: detected dubious ownership in repository at '/git'
To add an exception for this directory, call:

	git config --global --add safe.directory /git
@josejsarmento
Copy link
Author

josejsarmento commented Nov 24, 2022

A proposed 'fix' is passing -u $UID:$GID to the docker run commands. It could be relevant to include this in the README.

@rmie
Copy link
Contributor

rmie commented Feb 8, 2023

suggested change in #55

@ozbillwang
Copy link
Contributor

can't duplicate the issue now

$ docker run -ti --rm -v ${HOME}:/root -v $(pwd):/git alpine/git status

Digest: sha256:df3f712d8f82a4e6a408636dc52f1b52fc23e8f2d9f73a271a050961819daf95
Status: Downloaded newer image for alpine/git:latest
On branch master
Your branch is up to date with 'origin/master'.

nothing to commit, working tree clean

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants