fatal: open /dev/null or dup failed: No such file or directory

∥☆過路亽.° 提交于 2020-07-30 06:01:46

问题


I am new here and i will try to explain my question kindly ignore any mistakes.

I am using git version git-2.8.2 It worked fine for one day then this problem occurs. I am using gcloud repository. First I tried gcloud clone command then this error occurs

Then to make sure git is there I tired git command then this error occurs

Then I double check by opening git Bash but same error was there too.

I tried reinstalling changing directory. but nothing works.


回答1:


I face the same problem after I try to avoid memory leak in Windows 10. If you happened to change the regedit like me, just type regedit in the search then go to

HKEY_LOCAL_MACHINE -> SYSTEM -> ControlSet001 -> Services -> Null

change the value of Start to 1.




回答2:


I solved my problem accidentally. I would like to share it with everyone. It was not a problem of git or gcloud or source tree.

Actually I have forcefully stooped windows update from installing which causes this problem. Now when I install windows updates again this problem is fixed now. Maybe this helps someone.




回答3:


the similar situation in chrooted linux tree is fixable following way:

cd inside the folder where you are preparing the chroot dir, then

mount -o bind /dev dev/

then only chroot inside




回答4:


I had this weird bug just now. I went back a dir and tried git init, it worked there. I re-ran zsh and tried again in the dir it errored in originally and it worked. shrugs




回答5:


I accidentally bumped into the same problem when I was sorting out the services running on my computer with Windows 10.

fatal: open /dev/null or dup failed: No such file or directory

The reason was that I deleted the service named 'Null' that had no description as I thought that was a virus service.

Thus, when I found my git unable to operate, I reckoned the deleted service. According to a solution provided on some site I tried to run the service again using cmd.exe

sc config Null start= system
sc start Null

but it said the service hadn't been existed in the list. Thankfully, there are some kind folks who shares the information of the default services running on Windows 10 and the description necessary for the successful bringing back the service.

So as to get the service back in the list:

  1. press Win + R
  2. type regedit
  3. go to HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services section
  4. Create Null folder and all the params it needs.

  1. Restart your computer.
  2. Now you got your Null service back and your git back as well.

Hope this helps.



来源:https://stackoverflow.com/questions/37069502/fatal-open-dev-null-or-dup-failed-no-such-file-or-directory

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!