Win10安装git报错:could not open ‘/dev/null‘ for reading and writing: No such fileor directory

参考:win10安装git,出现 fatal: open /dev/null or dup failed: No Such file or directory解决方案_win git no such file or directory-CSDN博客

一、概述:

最近公司组织病毒扫描,不知道是不是扫描误删了我电脑的系统文件,导致git在电脑重启后就异常,idea的git功能无法正常使用,重新安装提示如下截图的异常:

Git 2.45.2 Setup
Unable to set system config"diff.astextplain.textcony":="astextplain": exit code 128
stderr:
fatal: could not open '/dev/null' for reading and writing: No such fileor directory

----------

×Git 2.45.2 SetupLine 3398: Could not reconfigure Scalar enlistments (output: , errors:fatal: could not open '/dev/null' for reading and writing: No such fileor directory, exit code: 128).

还有很多类似的,就不一一截图了。

二、解决方法:

大概原因是系统的null.sys文件丢失或者损坏,

1.修改注册表:HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\Null

2.从其他电脑win10系统复制一份null.sys文件,先删除自己系统的,再粘贴进去

路径:‪C:\Windows\System32\drivers\null.sys

注意:先验证系统文件是否可用:打开cmd窗口,执行如下命令:

sc stop null -- 停止服务
sc start null -- 启动服务
sc query null  -- 查询服务状态
sfc /scannow -- 修复文件

重点:请参考上面地址的文章,我也是从这篇文章取经的!!!

  • 5
    点赞
  • 8
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值