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 "当前目录" 
相关推荐
红豆子不相思7 小时前
Tomcat 环境搭建与集群实战
服务器·git·tomcat
杰哥技术分享8 小时前
Git 仓库迁移技术文档:从 CODING.net 迁移至腾讯云 CNB
git
梅孔立10 小时前
Ansible 100 台服务器一键管控实战 进阶版
服务器·git·ansible
qq_4260039621 小时前
git切换当前分支到远程分支
git
ON10N1 天前
100% 纯 Vibe Coding,我是怎么用 AI 撸出一个 VS Code 插件的
git·ai编程·visual studio code
Lunar*1 天前
告别臃肿!使用 git-filter-repo 优雅清理 Git 历史记录
git
tq10861 天前
agent 记忆 = markdown + json + git
人工智能·git
何以不说话1 天前
DevOps、Git 和 GitLab
git·gitlab·devops
最最菜的菜鸟1 天前
本地环境通过 SSH 协议访问 GitHub 上的仓库时,SSH 公钥认证失败,配置 Git SSH 密钥
git·ssh·github
无限进步_2 天前
21. 合并两个有序链表 - 题解与详细分析
c语言·开发语言·数据结构·git·链表·github·visual studio