升级到 Windows 10 后,Git-Bash 命令提示符不会打开
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/31887503/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Git-Bash Command Prompt won't open up after upgrading to Windows 10
提问by pelican
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 ?
我刚刚将操作系统升级到 Windows 10,Git Bash 甚至无法再打开。我可能需要再次卸载并重新安装它,但我只是想知道是否还有其他人在升级到 Windows 10 后遇到了这个问题,除了卸载和重新安装之外,他们的修复方法是什么?
采纳答案by Anantha Raju C
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.
很少有其他升级到 Windows 10 的用户在 Git Bash 和 git 方面遇到类似问题的情况。GitHub 上的 msysgit 已打开一个问题。官方澄清很快就会发布在该页面上。
A similar issue but not related to Git Bash particularly on Windows 10 platform is being resolved here.
此处解决了一个类似的问题,但与 Git Bash 无关,尤其是在 Windows 10 平台上。
If your issue is not very serious, it is advisable to uninstall and install an appropriate version of Git Bash for Windows 10.
如果您的问题不是很严重,建议您卸载并安装适用于 Windows 10 的适当版本的 Git Bash。
回答by Dhayal
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.
将 Windows 从 7 升级到 10 时,我必须面临同样的问题。我尝试重新安装 git bash,但重新安装对我不起作用。这是由于 shell 脚本解析器 sh.exe 文件的权限问题。您需要做的就是使用 bash 而不是 sh 作为您的 shell 脚本解析器。
you can do that as below.
你可以这样做。
Step 1:
第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"
右键单击并打开位于桌面或开始菜单中的 Git Bash 快捷方式的属性对话框(在我的 PC 中为 C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Git\Git Bash.lnk),您将看到“快捷方式”选项卡中的以下目标。
"C:\Program Files\Git\bin\sh.exe" --login -i"
只需将 sh.exe 替换为 bash.exe 如下
"C:\Program Files\Git\bin\bash.exe" --login -i"
Step 2 :
第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
解决 sh 命令的问题。
转到 Git Bash bin 文件夹(我 PC 中的 C:\Program Files\Git\bin)
进行备份:将 sh.exe 文件复制到 old-sh.exe 并删除 sh.exe 文件
打开 git bash 并执行以下命令。
- 光盘/bin
- ln /bin/bash.exe sh
it worked for me. don't know the same will workout for you.
它对我有用。不知道同样会为你锻炼。
回答by vbore
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 ).
我在 Windows 10 上也遇到了 git bash 问题。Git bash 甚至没有在 Windows 10 上打开(窗口在启动后不久就关闭了)。
To solve the problem all I had to do was to:
为了解决这个问题,我所要做的就是:
- Right click on the git bash icon
- Run as administrator.
- 右键单击 git bash 图标
- 以管理员身份运行。
The problem disappeared.
问题消失了。
回答by Dzeimsas Zvirblis
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.
这个问题太令人沮丧了……我遇到它的唯一原因是我签约的公司发给我一台全新安装了 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).
所以在尝试这个和那个的所有挫折之后,它终于打击了我...... VSCode 有一个集成的终端!shell 默认powershell.exe
在 VSCode 启动时使用,但您可以在用户设置 (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...
这对我很有用,如果你有同样的问题,我希望它对你有用......