Getting errors when using GitHub for Windows
Asked Answered
A

3

8

I suddenly got errors when I was using git last week, for no apparent reason. I only have access to a windows PC.

The errors I'm getting doesn't seem to give me any clear answers as to what went wrong, how, and what I need to do to fix it.

The error happened right after I cloned an empty repository, and I've been uninstalling and reinstalling GitHub for Windows ever since, I usually only use the Git Shell that comes installed with, but the GUI is also having problems doing anything beyond starting up.

The error in it's entirety:

WARNING: posh-git requires Git 1.7.2 or better. You have .
Couldn't open /dev/null: No such file or directory
Couldn't open /dev/null: No such file or directory

Every time I run a git command it gives me Couldn't open /dev/null: No such file or directory.

What I find weird is that it's looking for /dev/null, but considering I'm running on Windows /dev/null would never exist at all.

Does anyone know a workaround for this?

Areopagite answered 9/3, 2015 at 11:49 Comment(2)
I am also getting same kind of problem, but I don't have GitHub for Windows, only Git Bash and Sourcetree. Wonder if this could be related to une of recent Windows OS updates?Waikiki
Seems like it, however I have one desktop and one laptop. The laptop is where the issue arised, but both are running 8.1 and are updated. Only one of them give me errors. Ended up buying a new laptop, but it would be interesting to see if anyone comes up with a solution.Areopagite
D
4

Once you start your Powershell command window, run git --version. Github for windows installs msysGit

GitHub for Windows includes a fully functional version of msysGit — no need to install anything extra. You can pull up a PowerShell console within the context of any repository.

Github for windows download here

Help Here

There is some information on the uninstall github for windows page about removing left over files.

Github for windows uses posh-git for git to be used by powershell.

Verify execution of scripts is allowed with Get-ExecutionPolicy (should be RemoteSigned or Unrestricted). If scripts are not enabled, run PowerShell as Administrator and call Set-ExecutionPolicy RemoteSigned -Scope CurrentUser -Confirm.

Distaste answered 9/3, 2015 at 16:47 Comment(3)
When installing Github for Windows git isn't added as an environmental command, and I can't find the git executable to use either. I've ran through the install process atleast 20 times by now, as well as the uninstall process. I've set the execution policy in powershell to unrestricted or remotesigned, but still no cigar. Nothing works to be honest.Areopagite
I was hoping the manual install of posh-git would work for you. I would do it after an install of Github for windows.Distaste
Yes, I did it, but I don't think the issue really lies with posh-git considering the GUI is acting up as well. Git is pretty much broken as a whole on that computer.Areopagite
D
3

I encountered the same problem on my laptop and I spent a lot of time to understand and to solve it. Here is my experience.

The git error message (Couldn't open /dev/null (or dup failed) : No such file or directory) is a linux/unix one. In fact, what git is trying to say is that it cannot access to the null device of your system. In windows, there is a actually a null device that corresponds to an empty and invisible file, present in each folder.

  1. Here you can open a window console (cmd) and type the command echo sample > nul. If you get an error message, you actually have a problem with your null device.

  2. Identifying the problem :

    • Open the Device Manager
    • Menu View > Show hidden devices
    • Search for Null in Non-Plug and Play Drivers
  3. If it exists but is in warning, try this (source) :

    • Control Panel > Power Options
    • Change Plan Settings
    • Change Advanced Power Settings
    • Multimedia Settings
    • When sharing media > Setting : a setting other than Allow the Computer to Enter Away Mode
    • Restart the computer : if the problem continues, I would suggest you to backup the %SystemRoot%\system32\drivers\null.sys, remove the Null device (Right click > Uninstall) and go the the step 4.
  4. If it doesn't exist (or the step 3 doesn't repair the problem and after removing the Null device) :

    • Install the Null device by following this How-To (for Windows XP but it also works for Vista).
    • Restart the computer.
Derma answered 16/12, 2015 at 8:49 Comment(1)
I've been working on this problem all night, but still haven't figured it out. My null device isn't working. I have a good null.sys as far as I can tell (DISM and sfc no longer complain), but after applying step 4 I don't see any hidden devices under Non-Plug and Play Drivers. In fact, I can't find a null device anywhere in Device Management, even after doing 4. I'm on Windows 8.1.Arizona
M
0

Sorry I don't have the rep to comment yet, but, are you sure you have the latest version of "GitHub for Windows"? I have had problems before when it didn't auto-update.

Also, do you usually use the "Git Shell" that comes with it? This is what I usually do, so I didn't have any problems with losing configurations when I re-installed, not sure what happens if you use the main GUI program...

Marlysmarmaduke answered 9/3, 2015 at 16:32 Comment(1)
I've downloaded it multiple times, I usually use the Git Shell that comes with, yes. I've also tried the GUI but no real luck.Areopagite

© 2022 - 2024 — McMap. All rights reserved.