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 "当前目录" 
相关推荐
stu_kk1 小时前
Git常用操作指令
git
顾默@3 小时前
关于git推送到远程仓库的一些操作
git
___波子 Pro Max.6 小时前
Git 2.23新增命令switch使用指南
git
℘团子এ13 小时前
git中,项目怎么更换远程仓库连接地址
git
言之。18 小时前
Git Hooks
git
代码AI弗森19 小时前
Git Bash 与 PowerShell:定位差异、使用场景与选择建议
开发语言·git·bash
森叶21 小时前
Git flow command error: ‘flow‘ is not a git command 问题解决
git
天麓1 天前
git merge 举例
git
AI_56781 天前
Git冲突治理白皮书:智能标记与可视化协同的下一代解决方案
大数据·人工智能·git·机器学习
念丶小宇1 天前
Git常用指令
大数据·git·elasticsearch