GitBash not outputting to console

妖精的绣舞 提交于 2019-11-27 04:42:40

问题


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

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