Git报错fatal: detected dubious ownership in repository at /**/**/**

问题

git pull 报错

fatal: detected dubious ownership in repository at '/home/xxx/xx
To add an exception for this directory, call:
git config --global --add safe.directory xxx

执行了 git config --global --add safe.directory xxx 也没用

解决

发现是文件夹以及下面的文件,用户组和当前用户不一致,导致的
比方说:git项目文件夹的所属用户是root,而当前用户是ttz
执行 chown -R ttz:ttz /home/xxx/xx 修改即可

你可能感兴趣的:(git)