【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时,可能会遇一些错误信息,其中之一是"fatal: detected dubious ownership in repository at"。这个错误通常表示Git检测到仓库中的文件或目录的所有权存在问题。 这个错误可能有几种可能的原因: 1. 文件或目录的所有权被更改:Git跟踪文件和目录的所有权信息,如果这些信息被更改,就会导致这个错误。可能是由于操作系统或其他工具更改了文件或目录的所有权。 2. 文件或目录的权限设置不正确:Git还跟踪文件和目录的权限设置。如果权限设置不正确,也会导致这个错误。可能是由于操作系统或其他工具更改了文件或目录的权限。 3. Git配置问题:有时候,Git的配置可能会导致这个错误。可能是由于配置文件中的某些设置不正确。 为了解决这个问题,你可以尝试以下几个步骤: 1. 检查文件和目录的所有权和权限设置:确保文件和目录的所有权和权限设置正确。你可以使用命令`ls -l`来查看文件和目录的详细信息,并使用`chown`和`chmod`命令来更改所有权和权限设置。 2. 检查Git配置:检查你的Git配置文件,确保其中的设置正确。你可以使用命令`git config --list`来查看当前的Git配置。 3. 恢复仓库:如果以上步骤都没有解决问题,你可以尝试恢复仓库。首先备份你的仓库,然后删除仓库,并重新克隆一个新的仓库。 希望以上信息对你有帮助!如果你还有其他问题,请随时提问。
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

打赏作者

长毛山顶洞人

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

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

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

打赏作者

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

抵扣说明:

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

余额充值