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 "当前目录" 
相关推荐
Wpa.wk1 小时前
Git日志+分支管理+基础冲突解决
经验分享·git·测试工具
香水5只用六神9 小时前
【DMA】存储器到外设模式实验2
c语言·git·stm32·单片机·嵌入式硬件·github·visual studio
★浅_忆9 小时前
Git入门基础命令
git
待什么青丝10 小时前
同步 Git 仓库修改操作指南
git
Penguido10 小时前
解决 VS Code 中 Git 推送报错:ECONNREFUSED vscode-git.sock 与鉴权失败
linux·git·vscode
无限进步_11 小时前
【C++】只出现一次的数字 III:位运算的巧妙应用
数据结构·c++·git·算法·leetcode·github·visual studio
降临-max11 小时前
Git 从入门到进阶:基础命令与多分支
git
float_六七12 小时前
Git忽略规则终极指南
大数据·git·elasticsearch
无限进步_13 小时前
深入解析vector:一个完整的C++动态数组实现
c语言·开发语言·c++·windows·git·github·visual studio
Codeking__13 小时前
git常用命令小总结
git