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 "当前目录" 
相关推荐
.Hypocritical.9 小时前
Git 全套实操|配置 /.gitignore/ 分支合并 / 冲突解决 /git stash 完整教程
git
来日方长。。。。long10 小时前
Hermes Agent橙皮书共读|第三篇:保姆级实战部署|本地/VPS从零搭建Hermes
ide·git·hermes
其实防守也摸鱼10 小时前
VS Code Git 工作树:解锁多分支并行开发新体验
数据库·git·安全·oracle·架构·自动化
ERD Online11 小时前
我们怎么设计 good first issue:让第一个 PR 两小时内合入
数据库·git·后端·开源·issue
Python私教1 天前
Codex 自动写 Commit 够安全吗?一套证据化 Git 提交流程
人工智能·git·后端
果果燕1 天前
实习笔记(一):NFS、Samba、VNC、Git、CMake、systemd、内核、交叉编译
linux·arm开发·c++·笔记·git
美味蛋炒饭.1 天前
Git 版本控制(下)
开发语言·git·学习·总结·后端开发
互联网中的一颗神经元1 天前
09 — .git 地图:打开那个隐藏文件夹
大数据·git·elasticsearch
Patrick_Wilson1 天前
你知道 git check 的故事吗
git·程序员·命令行
互联网中的一颗神经元1 天前
10 — 对象模型:.git/objects 里到底装了什么
git