Git报错fatal_detected_dubious_ownership_in_repository如何解决
原创约 356 字大约 1 分钟...
Git报错fatal_detected_dubious_ownership_in_repository如何解决
注意
本博文仅供学术研究和交流参考,严禁将其用于商业用途。如因违规使用产生的任何法律问题,使用者需自行负责。
报错信息
Administrator@DESKTOP-DFD9CE5 MINGW64 /d/alibaba/studyLog
$ git status
fatal: detected dubious ownership in repository at 'D:/alibaba/studyLog'
'D:/alibaba/studyLog' is owned by:
'S-1-5-21-1768174577-13754125-2598047118-1001'
but the current user is:
'S-1-5-21-2607242180-1233388006-380827990-500'
To add an exception for this directory, call:
git config --global --add safe.directory D:/alibaba/studyLog
解决方法
这个错误提示说明当前 Git 仓库的所有权归属存在问题。在指定的仓库目录下, 存在一个所有者标识为 'S-1-5-21-1768174577-13754125-2598047118-1001', 但是当前用户标识为 'S-1-5-21-2607242180-1233388006-380827990-500'。 为了解决这个问题,Git 提供了一个安全机制,允许您在某些情况下添加目录的例外。 在您的情况下,Git 提示您执行以下命令来为该目录添加例外:
git config --global --add safe.directory D:/alibaba/studyLog
测试
- 如下图所示,解决了此问题

分割线
相关信息
以上就是我关于 Git报错fatal_detected_dubious_ownership_in_repository如何解决 知识点的整理与总结的全部内容,希望对你有帮助。。。。。。。
扩展知识
Powered by Waline v2.15.4