简体   繁体   English

如何在windows Git shell中运行./script.sh?

[英]How to run ./script.sh in windows Git shell?

Maybe it's awkward, but I can't run .sh file on Windows when working in Git shell. 也许这很尴尬,但是当我在Git shell中工作时,我无法在Windows上运行.sh文件。 Probably I have to install something, but I thought that Git will support that bash command (I know Windows don't use sh files). 可能我必须安装一些东西,但我认为Git将支持该bash命令(我知道Windows不使用sh文件)。

I am doing installation steps from GameClosure and after $ ./install.sh a window with application selection to open sh file appears (like that when you try to open unknown file in Windows, it asks what application to open this you would like to use). 我正在从GameClosure进行安装步骤,在$ ./install.sh一个打开sh文件的应用程序选择的窗口(就像当你尝试在Windows中打开未知文件时那样,它会询问你想要使用哪个应用程序打开它)。 I've tried open it with Git shell, but failed... What I have to do to run this file and proceed with installation steps from GameClosure tutorial?** 我试过用Git shell打开它,但是失败了...... 我要做什么来运行这个文件并从GameClosure教程继续安装步骤?**

Here is a screenshot (alert in polish, but I think you all know this message). 这是一个截图(波兰语提醒,但我想你们都知道这个消息)。 截图(波兰语)

Try using the git-bash available with msysgit , with the Git Bash.vbs shortcut. 尝试使用msysgit提供的git-bashGit Bash.vbs快捷方式。

Msysgit is also packaged within GitHub for Windows , even though the shell exposed is a Powershell one based on posh-git . Msysgit也打包GitHub for Windows中 ,即使暴露shell是基于posh-git 的Powershell That (powershell) would explain why *.sh scripts cannot run on it. 那(powershell)将解释为什么*.sh脚本无法在其上运行。

The OP Szorstki mentions in the comment that there actually is a setting in the GitHub for Windows app, that can set up Git Bash as the default command line tool. OP Szorstki 在评论中提到GitHub for Windows应用程序中实际存在一个设置,可以将Git Bash设置为默认命令行工具。

尝试安装bash for Windows并在从cmd.exe执行bash后再次运行脚本ag。

Invokes the right shell, no unnecessary windows and invokes a bash script afterwards which will be hold. 调用正确的shell,没有不必要的窗口,然后调用bash脚本将保留。

  • Create a Shortcut to mintty.exe on your desktop, for example 例如,在桌面上创建 mintty.exe 的快捷方式

  • Edit properties of the shortcut and change the target (keep the path): 编辑快捷方式的属性并更改目标(保留路径):

  • C:\\Program Files\\Git\\usr\\bin\\mintty.exe" -h always /bin/bash -l -e 'D:\\folder\\script.sh'

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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