Search code examples
windowsbashgitadmingit-bash

"Git Bash Here" creates a bash terminal with a nonfunctional version of git


I've suddenly started experiencing an issue on Windows 10 where right clicking in a git repo folder and selecting "Git Bash Here" returns a bash terminal that has a useless version of git in it.

I say that this version of git is useless because you can enter git commands, but nothing seems to happen. (git log is the only exception to this, as it works fine, showing the history of commits.) All of the other git <commands> return absolutely nothing. Not even an error is returned.

Things worth noting:

  • Sometimes (maybe every time?), before an unsuccessful git command is 'finished running,' a quick black prompt is seen flashing on the screen for a fraction of a second.
  • Right clicking and selecting Git GUI Here prompts me with an error window
    • Window title: "git-gui: fatal error"
    • Window content: "Cannot parse Git version string:"
  • Reinstalling does NOT solve the issue

Another coworker started experiencing this same issue a week before I did, so now I'm left wondering if a slow roll out of a Windows update was to blame, as we have the same desktop environment and IT department supporting it.

Question: How can I restore the functionality of "right click Git Bash Here" in Windows 10?


Solution

  • This error is resolved by altering compatibility mode on git-bash.exe (located in C:\Program Files\Git by default), specifically setting it to always run as administrator.

    This can be done by right clicking the executable (again, git-bash.exe), clicking Properties, the Compatibility tab, and then checking "Run this program as an administrator". Click Apply, then OK, and you should be all set.

    NOTE: Apply these same steps to git-gui.exe, located by default in C:\Program Files\Git\cmd, to fix the issue stated with the Git GUI Here selection in explorer's right click window.