alpine-docker / git

A useful simple git container running in alpine linux, especially for tiny linux distro, such as RancherOS, which don't have package manager.
Apache License 2.0
155 stars 86 forks source link

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

Closed josejsarmento closed 1 year ago

josejsarmento commented 1 year ago

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 commented 1 year ago

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

rmie commented 1 year ago

suggested change in https://github.com/alpine-docker/git/pull/55

ozbillwang commented 1 year ago

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