git 问题 --- fatal: detected dubious ownership in repository at

在通过 Git Bash 提交项目代码时输入 git pull 或git add . 命令后,报错:fatal: detected dubious ownership in repository at

这是因为该项目的所有者与现在的用户不一致

比如说: 该项目的所有者是 Administrator,而当前用户是 liu, 那么就会导致上面的错误

解决的办法也很简单在 git bash 中输入

bash 复制代码
git config --global --add safe.directory "*"

或者

bash 复制代码
git config --global --add safe.directory "当前目录" 
相关推荐
xiaok5 小时前
分支管理提交代码
git·gitlab·github
谢尔登7 小时前
【Git】merge 分类
git
NiKo_W7 小时前
Git 版本回退与撤销修改
开发语言·git·安全
渣渣小码1 天前
GIT客户端配置支持中文
git·git中文显示
鄃鳕1 天前
Git 拒绝 pull,本地有未提交的修改
git
Leslie_Lei1 天前
【Eclipse】eclipse打开git拉取的项目
java·git·eclipse
渣渣小码1 天前
GIT快速上手(常用指令)
git
会豪2 天前
Git命令-图解-小白专享
git
韦禾水2 天前
IntelliJ IDEA 2023更新git凭据
git·intellij idea
Yvonne爱编码2 天前
构建高效协作的桥梁:前后端衔接实践与接口文档规范详解
前端·git·ajax·webpack·node.js