git报错unsafe repository xxx is owned by someone else

git报错

git.exe pull --progress -v --no-rebase "origin" master
fatal: unsafe repository ('//xxx/home/workstation/work/git/testGithub' is owned by someone else)
To add an exception for this directory, call:

git config --global --add safe.directory '%(prefix)///xxx/home/workstation/work/git/testGithub'


git 未能顺利结束 (退出码 128) (234 ms @ 2022/5/6 16:44:01)

通常git建议

git config --global --add safe.directory '%(prefix)///xxx/home/workstation/work/git/testGithub'

使用建议的方法需要每个目录、子模块都配置一遍,很麻烦。
可以使用如下命令禁用safe.derectory检测

git config --global --add safe.directory *

windows在全局配置如下

[safe]
directory = *

你可能感兴趣的:(git,github)