运行报错(三)git bash报错fatal: detected dubious ownership in repository at

编程入门 行业动态 更新时间:2024-10-22 21:22:21

运行<a href=https://www.elefans.com/category/jswz/34/1771188.html style=报错(三)git bash报错fatal: detected dubious ownership in repository at"/>

运行报错(三)git bash报错fatal: detected dubious ownership in repository at

报错现象

在运行git 命令时,出现报错 “fatal: detected dubious ownership in repository at”


报错原因

文件夹的所有者和现在的用户不一致
栗子: 文件夹的所有者是root,而当前用户是admin


解决方案

方法一、
将文件夹的所有者替换成admin
将文件夹的所有者添加 admin
sudo -S setfacl -R -m u:switch_git:rwx ./

方法二、
在git bash中输入
git config --global --add safe.directory “*”

更多推荐

运行报错(三)git bash报错fatal: detected dubious ownership in repository at

本文发布于:2023-12-03 20:35:15,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1657368.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:报错   bash   git   fatal   repository

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!