6

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 enter image description here

Then to make sure git is there I tired git command then this error occursenter image description here

Then I double check by opening git Bash but same error was there too. enter image description here

I tried reinstalling changing directory. but nothing works.

Inian
  • 80,270
  • 14
  • 142
  • 161
Yasir Ijaz
  • 674
  • 1
  • 12
  • 19

5 Answers5

29

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.

Jingyu Bao
  • 401
  • 4
  • 5
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.

enter image description here

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.

enter image description here

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

enter image description here

Hope this helps.

  • Omg I kept getting the same null directory not found problem when I tried to use OpenSSH. The sc config Null start= system; sc start Null; worked like a charm. Thank you so much! <3 – Liviosah Apr 26 '21 at 15:27
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.

Yasir Ijaz
  • 674
  • 1
  • 12
  • 19
2

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

Oleg Kokorin
  • 2,288
  • 2
  • 16
  • 28
0

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

Arthur Bowers
  • 581
  • 5
  • 9