Skip to content

Output from git commands not visible in GitBash #2064

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
1 task done
grahamshanks opened this issue Feb 11, 2019 · 28 comments
Closed
1 task done

Output from git commands not visible in GitBash #2064

grahamshanks opened this issue Feb 11, 2019 · 28 comments

Comments

@grahamshanks
Copy link

  • I was not able to find an open or closed issue matching what I'm seeing

Setup

  • Which version of Git for Windows are you using? Is it 32-bit or 64-bit?
$ git --version --build-options

git version 2.20.1.windows.1
cpu: x86_64
built from commit: 7c9fbc07db0e2939b36095df45864b8cda19b64f
sizeof-long: 4
sizeof-size_t: 8
  • Which version of Windows are you running? Vista, 7, 8, 10? Is it 32-bit or 64-bit?
$ cmd.exe /c ver

Microsoft Windows [Version 6.1.7601]

64-bit Windows 7

  • What options did you set as part of the installation? Or did you choose the
    defaults?
# One of the following:
> type "C:\Program Files\Git\etc\install-options.txt"
> type "C:\Program Files (x86)\Git\etc\install-options.txt"
> type "%USERPROFILE%\AppData\Local\Programs\Git\etc\install-options.txt"
$ cat /etc/install-options.txt

Editor Option: CustomEditor
Custom Editor Path: C:\Notepad++Portable\Notepad++Portable.exe
Path Option: Cmd
SSH Option: OpenSSH
CURL Option: OpenSSL
CRLF Option: CRLFAlways
Bash Terminal Option: MinTTY
Performance Tweaks FSCache: Enabled
Use Credential Manager: Enabled
Enable Symlinks: Disabled
  • Any other interesting things about your environment that might be related
    to the issue you're seeing?

Don't think so

Details

  • Which terminal/shell are you running Git from? e.g Bash/CMD/PowerShell/other

Bash

git --version
  • What did you expect to occur after running these commands?

The git version number to be displayed in the Bash terminal

  • What actually happened instead?

No output displayed.

This seems to be the case for all git commands. Ordinary shell commands (such as ls, and less) output as expected

If I pipe the output to a file then the file contains the expected output, e.g.

$ git --version >> version.txt 
$ cat version.txt
git version 2.20.1.windows.1

If I force an error, for instance by changing to a directory that does not contain a git repository then the error message is displayed, e.g.

$ git status
fatal: not a git repository (or any of the parent directories): .git

A colleague installed 2.20.0 on another machine and was getting a similar issue.

Running git commands from a normal command window gives the output expected

  • If the problem was occurring with a specific repository, can you provide the
    URL to that repository to help us with testing?

Does not appear to be repository specific

@dscho
Copy link
Member

dscho commented Feb 21, 2019

Is this still happening with v2.21.0-rc2?

@dscho dscho added the unclear label Feb 21, 2019
@grahamshanks
Copy link
Author

Still happening with v2.21.0

Note that preceding commands with winpty will cause the output to be displayed. As a workaround this is OK but it appears that the main purpose of having a GitBash shell, namely to run git on the command line, ought not to require winpty

@dscho
Copy link
Member

dscho commented Mar 11, 2019

Are you sure that you're running this in Git's Bash, not e.g. Cygwin's Bash?

@grahamshanks
Copy link
Author

Don't have Cygwin installed. Opened GitBash from the Windows Start menu (opening with a right click from Windows Explorer is the same). Prompt contains MINGW64

@dscho
Copy link
Member

dscho commented Mar 12, 2019

Can you provide the (redacted, if necessary to hide secrets) output of GIT_TRACE=1 git version, which git, and env?

@grahamshanks
Copy link
Author

$ GIT_TRACE=1 git version
09:31:36.868999 exec-cmd.c:236          trace: resolved executable dir: C:/Program Files/Git/mingw64/bin
09:31:36.870000 git.c:419               trace: built-in: git version
$ which git
/mingw64/bin/git
$ env
	USERDOMAIN=XXXXXXXXX
	OS=Windows_NT
	COMMONPROGRAMFILES=C:\Program Files\Common Files
	PROCESSOR_LEVEL=6
	simlink_sisoj=-port 3000
	PSModulePath=C:\WINDOWS\system32\WindowsPowerShell\v1.0\Modules\
	CommonProgramW6432=C:\Program Files\Common Files
	EXISTING_CLASSPATH=.;d:\applications\CodeCounterv8.0
	CommonProgramFiles(x86)=C:\Program Files (x86)\Common Files
	JAVA_INCLUDE=C:\Program Files\Java\jdk1.8.0_131\include
	FP_NO_HOST_CHECK=NO
	LANG=en_US.UTF-8
	MSYSTEM_CARCH=x86_64
	DISPLAY=needs-to-be-defined
	HOSTNAME=C559129
	PUBLIC=C:\Users\Public
	CONFIG_SITE=/mingw64/etc/config.site
	EXEPATH=C:\Program Files\Git
	MSYSTEM_CHOST=x86_64-w64-mingw32
	UATDATA=C:\WINDOWS\CCM\UATData\XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
	USERNAME=graham.shanks
	ChocolateyInstall=C:\ProgramData\chocolatey
	LOGONSERVER=\\ZZZZZZZZZZ
	PROCESSOR_ARCHITECTURE=AMD64
	VSEDEFLOGDIR=C:\ProgramData\McAfee\DesktopProtection
	JAVA_BIN=C:\Program Files\Java\jdk1.8.0_131\bin
	LOCALAPPDATA=C:\Users\graham.shanks\AppData\Local
	CLASSPATH=.;d:\applications\CodeCounterv8.0;E:\Program Files\prti1516e\lib\prti1516e.jar;E:\Program Files\prti1516e\lib\prti.jar
	COMPUTERNAME=C559129
	DEFLOGDIR=C:\ProgramData\McAfee\DesktopProtection
	SYSTEMDRIVE=C:
	USERPROFILE=C:\Users\graham.shanks
	PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC
	SYSTEMROOT=C:\WINDOWS
	HOMESHARE=\\XXXXX\YYYY_Graham.Shanks$
	USERDOMAIN_ROAMINGPROFILE=XXXXXXXXX
	PROCESSOR_IDENTIFIER=Intel64 Family 6 Model 60 Stepping 3, GenuineIntel
	MINGW_PACKAGE_PREFIX=mingw-w64-x86_64
	PWD=/h/
	SSH_ASKPASS=/mingw64/libexec/git-core/git-gui--askpass
	HOME=/h/
	TMP=/tmp
	windows_tracing_logfile=C:\BVTBin\Tests\installpackage\csilogfile.log
	MSYSTEM_PREFIX=/mingw64
	VS100COMNTOOLS=e:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\Tools\
	VS120COMNTOOLS=E:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\Tools\
	PROCESSOR_REVISION=3c03
	TMPDIR=/tmp
	DeviceOS=Windows7
	VCINSTALLDIR=E:\Program Files (x86)\Microsoft Visual Studio 14.0\VC
	USERDNSDOMAIN=XXXXXXXXX.NET
	NUMBER_OF_PROCESSORS=8
	ProgramW6432=C:\Program Files
	windows_tracing_flags=3
	GIT_LFS_PATH=C:\Program Files\Git LFS
	COMSPEC=C:\WINDOWS\system32\cmd.exe
	APPDATA=C:\Users\graham.shanks\AppData\Roaming
	SHELL=/usr/bin/bash
	TERM=xterm
	SHFBROOT=E:\Program Files (x86)\EWSoftware\Sandcastle Help File Builder\
	WINDIR=C:\WINDOWS
	MINGW_CHOST=x86_64-w64-mingw32
	ProgramData=C:\ProgramData
	SHLVL=1
	PLINK_PROTOCOL=ssh
	ACLOCAL_PATH=/mingw64/share/aclocal:/usr/share/aclocal
	PROGRAMFILES=C:\Program Files
	MANPATH=/mingw64/local/man:/mingw64/share/man:/usr/local/man:/usr/share/man:/usr/man:/share/man
	ORIGINAL_TEMP=/tmp
	ORIGINAL_TMP=/tmp
	ALLUSERSPROFILE=C:\ProgramData
	TEMP=/tmp
	MSYSTEM=MINGW64
	MINGW_PREFIX=/mingw64
	SESSIONNAME=Console
	PATH=/h//bin:/mingw64/bin:/usr/local/bin:/usr/bin:/bin:/mingw64/bin:/usr/bin:/h/bin:/cmd:/e/Program Files/prti1516e/lib/vc100_64:/e/Program Files/prti1516e/lib/vc100_64/oldtime:/e/Program Files/prti1516e/lib:/e/Program Files/prti1516e/jre/bin/server:/c/ProgramData/Oracle/Java/javapath:/c/Program Files (x86)/NVIDIA Corporation/PhysX/Common:/c/Program Files (x86)/Intel/iCLS Client:/c/Program Files/Intel/iCLS Client:/c/WINDOWS/system32:/c/WINDOWS:/c/WINDOWS/System32/Wbem:/c/WINDOWS/System32/WindowsPowerShell/v1.0:/c/Program Files/Intel/Intel(R) Management Engine Components/DAL:/c/Program Files/Intel/Intel(R) Management Engine Components/IPT:/c/Program Files (x86)/Intel/Intel(R) Management Engine Components/DAL:/c/Program Files (x86)/Intel/Intel(R) Management Engine Components/IPT:/c/Program Files (x86)/Intel/OpenCL SDK/3.0/bin/x86:/c/Program Files (x86)/Intel/OpenCL SDK/3.0/bin/x64:/c/Program Files (x86)/Microsoft Application Virtualization Client:/c/Program Files (x86)/Microsoft Office/Office14:/c/Program Files (x86)/Microsoft SQL Server/100/Tools/Binn:/c/Program Files/Microsoft SQL Server/100/Tools/Binn:/c/Program Files/Microsoft SQL Server/100/DTS/Binn:/c/Program Files (x86)/Microsoft SQL Server/90/Tools/binn:/d/Program Files/doxygen/bin:/c/Program Files/TortoiseSVN/bin:/c/Program Files/Company X/DCF/bin:/c/ProgramData/chocolatey/bin:/e/Program Files (x86)/Microsoft Visual Studio 10.0/VC/bin:/c/Program Files (x86)/WebEx/PTools020000000:/d/SEtools/HEI/lib:/c/Program Files/1E/NomadBranch:/e/Program Files/nodejs:/e/Program Files/TortoiseHg:/c/Program Files (x86)/Windows Kits/8.1/Windows Performance Toolkit:/c/Program Files/Microsoft SQL Server/110/Tools/Binn:/c/Program Files (x86)/Microsoft SDKs/TypeScript/1.0:/c/Program Files/Microsoft SQL Server/120/Tools/Binn:/c/Program Files/TortoiseGit/bin:/c/Program Files/Git LFS:/e/Program Files/OpenCppCoverage:/e/Program Files/Saxonica/SaxonHE9.6N/bin:/c/Program Files (x86)/CMake/bin:/d/applications/CodeCounterv8.02:/c/Users/graham.shanks/AppData/Roaming/npm:/usr/bin/vendor_perl:/usr/bin/core_perl
	PS1=\[\033]0;$TITLEPREFIX:$PWD\007\]\n\[\033[32m\]\u@\h \[\033[35m\]$MSYSTEM \[\033[33m\]\w\[\033[0m\]\n$ 
	WIX=C:\Program Files (x86)\WiX Toolset v3.11\
	HOMEDRIVE=H:
	PKG_CONFIG_PATH=/mingw64/lib/pkgconfig:/mingw64/share/pkgconfig
	INFOPATH=/usr/local/info:/usr/share/info:/usr/info:/share/info
	HOMEPATH=\
	PROGBF5A6F14052=1
	ORIGINAL_PATH=/mingw64/bin:/usr/bin:/h/bin:/cmd:/e/Program Files/prti1516e/lib/vc100_64:/e/Program Files/prti1516e/lib/vc100_64/oldtime:/e/Program Files/prti1516e/lib:/e/Program Files/prti1516e/jre/bin/server:/c/ProgramData/Oracle/Java/javapath:/c/Program Files (x86)/NVIDIA Corporation/PhysX/Common:/c/Program Files (x86)/Intel/iCLS Client:/c/Program Files/Intel/iCLS Client:/c/WINDOWS/system32:/c/WINDOWS:/c/WINDOWS/System32/Wbem:/c/WINDOWS/System32/WindowsPowerShell/v1.0:/c/Program Files/Intel/Intel(R) Management Engine Components/DAL:/c/Program Files/Intel/Intel(R) Management Engine Components/IPT:/c/Program Files (x86)/Intel/Intel(R) Management Engine Components/DAL:/c/Program Files (x86)/Intel/Intel(R) Management Engine Components/IPT:/c/Program Files (x86)/Intel/OpenCL SDK/3.0/bin/x86:/c/Program Files (x86)/Intel/OpenCL SDK/3.0/bin/x64:/c/Program Files (x86)/Microsoft Application Virtualization Client:/c/Program Files (x86)/Microsoft Office/Office14:/c/Program Files (x86)/Microsoft SQL Server/100/Tools/Binn:/c/Program Files/Microsoft SQL Server/100/Tools/Binn:/c/Program Files/Microsoft SQL Server/100/DTS/Binn:/c/Program Files (x86)/Microsoft SQL Server/90/Tools/binn:/d/Program Files/doxygen/bin:/c/Program Files/TortoiseSVN/bin:/c/Program Files/Company X/DCF/bin:/c/ProgramData/chocolatey/bin:/e/Program Files (x86)/Microsoft Visual Studio 10.0/VC/bin:/c/Program Files (x86)/WebEx/PTools020000000:/d/SEtools/HEI/lib:/c/Program Files/1E/NomadBranch:/e/Program Files/nodejs:/e/Program Files/TortoiseHg:/c/Program Files (x86)/Windows Kits/8.1/Windows Performance Toolkit:/c/Program Files/Microsoft SQL Server/110/Tools/Binn:/c/Program Files (x86)/Microsoft SDKs/TypeScript/1.0:/c/Program Files/Microsoft SQL Server/120/Tools/Binn:/c/Program Files/TortoiseGit/bin:/c/Program Files/Git LFS:/e/Program Files/OpenCppCoverage:/e/Program Files/Saxonica/SaxonHE9.6N/bin:/c/Program Files (x86)/CMake/bin:/d/applications/CodeCounterv8.02:/c/Users/graham.shanks/AppData/Roaming/npm
	VS140COMNTOOLS=E:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\Tools\
	VS110COMNTOOLS=C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\Tools\
	_=/usr/bin/env

@dscho
Copy link
Member

dscho commented Mar 12, 2019

Another hunch: does git.exe version work?

@grahamshanks
Copy link
Author

Still no displayed text

@dscho
Copy link
Member

dscho commented Mar 13, 2019

Does git -P help -a show any output? Or TERM=dumb git var GIT_EDITOR?

@sentiment-bot

This comment has been minimized.

@PhilipOakley

This comment has been minimized.

@dscho

This comment has been minimized.

@grahamshanks
Copy link
Author

git -P help -a does show output

However, TERM=dumb git var GIT_EDITOR does not

@sentiment-bot

This comment has been minimized.

@grahamshanks
Copy link
Author

More information:

Output is displayed with prerelease-v2.11.0.windows.1.1 (git version 2.10.2.windows.1.895.g8126884) released Dec 9, 2016

Output is not displayed on the next release: v2.11.1.windows-prerelease.1 released Dec 23, 2016

I've also tried installing 2.21.0 in VM running a plain vanilla Windows 7 - it works OK

@dscho
Copy link
Member

dscho commented Mar 13, 2019

git -P help -a does show output

That is stdout.

However, TERM=dumb git var GIT_EDITOR does not

And that is stderr.

So it seems that stderr is suppressed, but stdout is shown.

However, the original report stated that git --version's output is not shown. And that command outputs to stdout, too. Meaning that stdout was suppressed (and the GIT_TRACE which is sent to stderr was shown).

Which kinda contradicts each other...

Output is displayed with prerelease-v2.11.0.windows.1.1 (git version 2.10.2.windows.1.895.g8126884) released Dec 9, 2016

Output is not displayed on the next release: v2.11.1.windows-prerelease.1 released Dec 23, 2016

Unfortunately the diff is pretty large:

118 files changed, 50942 insertions(+), 39137 deletions(-)

Also, there were 1295 commits between those two revisions :-(

Additionally, I just powered up my 2008R2 SP1 VM and launched a git version, and it worked just fine:

$ git version
git version 2.20.1.windows.1

$ cmd //c ver

Microsoft Windows [Version 6.1.7601]

So I am really, really puzzled now.

@sidchat04
Copy link

I have the same issue. Any clues on how to fix this?

@dscho
Copy link
Member

dscho commented Apr 12, 2019

@sidchat04 for starters, could you try to pinpoint (e.g. by installing and testing the PortableGit) which Git version was the first one to break in your scenario.

@sidchat04
Copy link

@dscho I tried installing the PortableGit, and surprisingly, the latest version seems to work as expected there. I uninstalled and re-installed the normal Git for Windows after this, but still facing the same issue.

@sidchat04
Copy link

@dscho This gave me an idea, and I uninstalled and re-installed Git for Windows again. But this time, instead of installing at the regular "Program Files" path, I installed it in a different location. And it worked! I am still not sure what exactly is wrong, though.

@dscho
Copy link
Member

dscho commented Apr 14, 2019

instead of installing at the regular "Program Files" path, I installed it in a different location. And it worked!

Oh wow! Good find.

Now, what does this mean, though... ;-)

Can you verify that calling blocked-file-util.exe in your Git Bash (from the Program Files installation) does not show any output?

@sidchat04
Copy link

sidchat04 commented Apr 15, 2019

It does show an output

Usage: C:\Program Files\Git\mingw64\bin\blocked-file-util.exe <command> [<arguments>...]
Commands:
blocking-pids <top-level-directory>
recycle <path>

@dscho
Copy link
Member

dscho commented Apr 15, 2019

Hmm. Is it possible that there is any GIT_* environment variable set? For example, GIT_REDIRECT_STDERR?

@sidchat04
Copy link

Nope. I just checked.
The strange thing is, some commands are working as they should. For example "git branch" works as expected. Where as "git status" or "git remote" don't produce any output.

Another thing I tried, was to use the portable installation's exe from within the Program Files installation's Git bash, and it works as expected.
When I tried doing vice-versa, I still saw the same issues. Don't know if this helps at all though.

@dscho
Copy link
Member

dscho commented Apr 15, 2019

Hmm. Can you recompile Git in a Git for Windows SDK? If you can do that, you could add some debug print statements so that we can find out in a more direct manner what is happening here.

@dscho dscho closed this as completed Mar 8, 2020
@RammySekham
Copy link

I was very happy with old git (git bash for windows) version, I can copy paste paths/commands and it shows output in console. Lately I updated my version to 2.29.2.windows.2. It doesn't show output for some commands and no copy-paste privilege. Found this thread. Bit new to software programming. Any help will be highly appreciated.

@dscho
Copy link
Member

dscho commented Dec 13, 2020

@RammySekham how about opening a new ticket, providing a high quality bug report?

@RammySekham
Copy link

Sure

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants