【Git】报错处理:fatal: detected dubious ownership in repository at .....Set the environment variable GIT_T

【Git】报错处理:fatal: detected dubious ownership in repository at .....

异常信息

Windows PowerShell
版权所有 (C) Microsoft Corporation。保留所有权利。

尝试新的跨平台 PowerShell https://aka.ms/pscore6

PS C:\Users\Administrator\Desktop\she_qu_tuan_gou\_work\drivers> 
PS C:\Users\Administrator\Desktop\she_qu_tuan_gou\_work\drivers> 
PS C:\Users\Administrator\Desktop\she_qu_tuan_gou\_work\drivers> git pull
fatal: detected dubious ownership in repository at 'C:/Users/Administrator/Desktop/she_qu_tuan_gou/_work/drivers'
To add an exception for this directory, call:

        git config --global --add safe.directory C:/Users/Administrator/Desktop/she_qu_tuan_gou/_work/drivers    

Set the environment variable GIT_TEST_DEBUG_UNSAFE_DIRECTORIES=true and run
again for more information.
PS C:\Users\Administrator\Desktop\she_qu_tuan_gou\_work\drivers> 
PS C:\Users\Administrator\Desktop\she_qu_tuan_gou\_work\drivers> 
PS C:\Users\Administrator\Desktop\she_qu_tuan_gou\_work\drivers> git config --global --add safe.directory C:/Users/Administrator/Desktop/she_qu_tuan_gou
/_work/drivers
PS C:\Users\Administrator\Desktop\she_qu_tuan_gou\_work\drivers> 
PS C:\Users\Administrator\Desktop\she_qu_tuan_gou\_work\drivers> git pull
Already up to date.
PS C:\Users\Administrator\Desktop\she_qu_tuan_gou\_work\drivers> 

解决

git config --global --add safe.directory C:/Users/Administrator/Desktop/she_qu_tuan_gou/_work/drivers 

在这里插入图片描述

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 1
    评论
由于项目所有者变更导致git文件夹权限错乱,无法进行git操作,报错信息为"fatal: detected dubious ownership in repository". 解决这个问题的方法有两种,一种是通过输入命令"git config --global --add safe.directory <repository_path>"来添加对该目录的例外,例如"git config --global --add safe.directory F:/IdeaTestWorkSpace/2021/ZQMQ" [1 [3。另一种方法是通过输入命令"git config --global --add safe.directory <repository_path>"来添加对所有git仓库的例外,但这需要在每个git仓库中单独操作,且可能会导致git config列表中出现一长串的操作记录。所以你可以选择根据具体情况选择其中一种方法来解决问题。<span class="em">1</span><span class="em">2</span><span class="em">3</span> #### 引用[.reference_title] - *1* [git pull拉取报错fatal: detected dubious ownership in repository](https://blog.csdn.net/BovinLee/article/details/130100997)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT3_1"}}] [.reference_item style="max-width: 33.333333333333336%"] - *2* [【Gitfatal: detected dubious ownership in repository 解决方法](https://blog.csdn.net/weixin_52954097/article/details/128875480)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT3_1"}}] [.reference_item style="max-width: 33.333333333333336%"] - *3* [git fatal: detected dubious ownership in repository 解决方法](https://blog.csdn.net/tcjy1000/article/details/127129224)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT3_1"}}] [.reference_item style="max-width: 33.333333333333336%"] [ .reference_list ]

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

长毛山顶洞人

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值