问题
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.
回答1:
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.
回答2:
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 >
来源:https://stackoverflow.com/questions/53605378/gitbash-not-outputting-to-console