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 "当前目录" 
相关推荐
修己xj14 小时前
Gogs: 打造属于你自己的轻量级 Git 服务
git
Mediary15 小时前
Git本地忽略文件夹,只拉取目标文件夹
git
MY_TEUCK20 小时前
【git工具篇】Git 常用实战手册:从基础命令到分支冲突解决(开发实战版)
大数据·git
幸运的大号暖贴21 小时前
解决Vibe Coding时Idea经常不自动git add问题
java·人工智能·git·intellij-idea·claudecode·opencode
摇滚侠1 天前
如何打开 GitHub,GitHub 是基于 Git 版本控制系统的在线代码托管平台
git·github
MY_TEUCK1 天前
【Git 实习生小白专用】:最安全、永不翻车、公司最爱 的标准版本控制工作流程
git·安全·github
donecoding1 天前
第一次用 git worktree,连踩了三个坑(附无痛清理姿势)
git
spmcor1 天前
解决 Git 中已跟踪目录无法被 .gitignore 忽略的问题
git
qcx231 天前
【AI Engineering · Harness 系列】02 确定性外壳 × 非确定性内核——git push 红线的故事
人工智能·git·prompt·agent·engineering·harness
水云桐程序员1 天前
10 分钟 Git 上手教程
git