8

GitBash suddenly stopped working correctly. I tried uninstalling and reinstalling with no avail.

git commands seem to execute, but doesn't show anything in the console. For instance, I can pull, push, init and it works, but nothing shows on the command line.

git --version doesn't return anything to the console.

However, if I output it to a file with git --version > output.txt, it shows correctly in the file.

Also doesn't show the current branch on the command line. Newly reinstalled. Am I missing some config or is it some windows issues, or something else?

I'm running git version 2.19.2.windows.1 on windows 7.

git --version in the windows command line works fine, but not in GitBash.

bobby8767
  • 113
  • 1
  • 5

2 Answers2

3

That has happened to me a few times in Windows. In each case, this post held the secret.

In my case, the cursor didn't move, or show my typing onscreen. However, it actually executed the command (if I pressed Enter), even though it looked like I didn't type anything in!

The solution was to type reset < Enter >

It'sNotMe
  • 1,184
  • 1
  • 9
  • 29
2

Try and re-install Git for Windows, possibly through the portable versionl like PortableGit-2.20.0.rc2.windows.1-64-bit.7z.exe (an archive you can uncompress anywhere you want), and a simplified PATH.

set PATH=C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\
set GH=C:\path\to\git
set PATH=%GH%\bin;%GH%\usr\bin;%GH%\mingw64\bin;%PATH%

Then check in that session (the one with said simplified path) if the issue persists.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • Issue still persists. It's fine if I run git --version in the windows command line, but not in GitBash I don't think the path is the issue. In GitBash, if I nagivate to git.exe in Portable Git/bin, and run ./git.exe --version, the issue of not showing anything in the console is still there. `$ echo $PATH `/c/Users/lauv.CORPDOM/Desktop/PortableGit/bin:/c/Users/lauv.CORPDOM/Desktop/PortableGit/usr/bin:/c/Users/lauv.CORPDOM/Desktop/PortableGit/mingw64/bin:/c/windows/system32:/c/windows:/c/windows/system32/wbem:/c/windows/system32/windowspowershell/v1.0 – bobby8767 Dec 05 '18 at 07:01
  • @vvvvv I suppose the result is the same without navigating to the bin folder, typing simply `git --version`? (no `.exe` should be needed) – VonC Dec 05 '18 at 08:24
  • Yes, that's right. Simply calling git --version and running the executable directly both doesn't return anything to the console. – bobby8767 Dec 05 '18 at 22:47
  • @vvvvv Strange: some kind of stdout/stderr redirection issue. – VonC Dec 05 '18 at 22:49