Repository navigation
Output from git commands not visible in GitBash #2064
Copy link
Copy link
Closed
Labels
Description
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
- What commands did you run to trigger this issue? If you can provide a
Minimal, Complete, and Verifiable example
this will help us understand the issue.
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
Reactions are currently unavailable
Activity
dscho commentedon Feb 21, 2019
Is this still happening with v2.21.0-rc2?
grahamshanks commentedon Mar 11, 2019
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 commentedon Mar 11, 2019
Are you sure that you're running this in Git's Bash, not e.g. Cygwin's Bash?
grahamshanks commentedon Mar 12, 2019
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 commentedon Mar 12, 2019
Can you provide the (redacted, if necessary to hide secrets) output of
GIT_TRACE=1 git version,which git, andenv?grahamshanks commentedon Mar 12, 2019
dscho commentedon Mar 12, 2019
Another hunch: does
git.exe versionwork?grahamshanks commentedon Mar 12, 2019
Still no displayed text
dscho commentedon Mar 13, 2019
Does
git -P help -ashow any output? OrTERM=dumb git var GIT_EDITOR?sentiment-bot commentedon Mar 13, 2019
PhilipOakley commentedon Mar 13, 2019
dscho commentedon Mar 13, 2019
grahamshanks commentedon Mar 13, 2019
git -P help -adoes show outputHowever,
TERM=dumb git var GIT_EDITORdoes not1 remaining item
grahamshanks commentedon Mar 13, 2019
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 commentedon Mar 13, 2019
That is stdout.
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...
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:So I am really, really puzzled now.
sidchat04 commentedon Apr 11, 2019
I have the same issue. Any clues on how to fix this?
dscho commentedon 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 commentedon Apr 14, 2019
@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 commentedon Apr 14, 2019
@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 commentedon Apr 14, 2019
Oh wow! Good find.
Now, what does this mean, though... ;-)
Can you verify that calling
blocked-file-util.exein your Git Bash (from the Program Files installation) does not show any output?sidchat04 commentedon 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 commentedon Apr 15, 2019
Hmm. Is it possible that there is any
GIT_*environment variable set? For example,GIT_REDIRECT_STDERR?sidchat04 commentedon Apr 15, 2019
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 commentedon 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.
RammySekham commentedon Dec 13, 2020
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 commentedon Dec 13, 2020
@RammySekham how about opening a new ticket, providing a high quality bug report?
RammySekham commentedon Dec 15, 2020
Sure