简体   繁体   中英

Git-Bash Command Prompt won't open up after upgrading to Windows 10

I just upgraded my OS to Windows 10 and Git Bash won't even open up anymore. I might need to uninstall and re-install it again but I was just wondering if anyone else ran into this problem after upgrading to Windows 10 and what their fix was other than un-installing and re-installing ?

I have to face the same problem when upgraded my windows from 7 to 10. I tried by reinstalling the git bash but re installation not works for me.it is due to the permission issue with the shell script parser sh.exe file. all you need to do is use bash as your shell script parser instead of sh.

you can do that as below.

Step 1:

Resolve the issue with the shortcut

  • right click and open properties dialog of the Git Bash short cut located in your desktop or in your start menu (C:\\ProgramData\\Microsoft\\Windows\\Start Menu\\Programs\\Git\\Git Bash.lnk in my PC), you will see the below Target in the "Short cut" tab.

    "C:\\Program Files\\Git\\bin\\sh.exe" --login -i"

    just replace sh.exe to bash.exe as below

    "C:\\Program Files\\Git\\bin\\bash.exe" --login -i"

Step 2 :

  • Resolve the problems with the sh commands.

    Go to the Git Bash bin folder (C:\\Program Files\\Git\\bin in my PC)

    Take a backup : copy the sh.exe file into old-sh.exe and delete the sh.exe file

    open the git bash and execute below commands.

    • cd /bin
    • ln /bin/bash.exe sh

it worked for me. don't know the same will workout for you.

There have been few instances where other users who have upgraded to windows 10 are facing similar issues with respect to Git Bash and git in general. An issue has been opened with msysgit on GitHub. Official clarification will be posted on that page very soon.

A similar issue but not related to Git Bash particularly on Windows 10 platform is being resolved here.

If your issue is not very serious, it is advisable to uninstall and install an appropriate version of Git Bash for Windows 10.

I had issues with git bash on windows 10 as well. Git bash was not even opening on windows 10 ( the window was getting closed soon after the launch ).

To solve the problem all I had to do was to:

  1. Right click on the git bash icon
  2. Run as administrator.

The problem disappeared.

This issue has been so damn frustrating... and the only reason I'm going through it is because the company I'm contracting for issued me a DELL laptop with a fresh install of Windows 10.

So after all the frustration of trying this and that, it finally hit me... VSCode has an integrated terminal! The shell defaults to powershell.exe on startup of VSCode but you can change that in your user settings (settings.json).

The "Default User Settings" look like this:

{
  // The path of the shell that the terminal uses on Windows.
  "terminal.integrated.shell.windows": 
  "C:\\WINDOWS\\System32\\WindowsPowerShell\\v1.0\\powershell.exe",
}

Change your "User Settings" look like this:

{
  // The path of the shell that the terminal uses on Windows.
  "terminal.integrated.shell.windows": 
  "C:\\Users\\<UserName>\\AppData\\Local\\Programs\\Git\\bin\\bash.exe"
}

This works great for me and if you're having the same issue, I hope it works for you...

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM