1.下载Git-2.32.0.2-64-bit 下载传送门
2.傻瓜式安装即可
3.图标右键==>打开文件所在位置 定位到安装路径.
4.配置环境变量.
我的电脑==>右键 ==>属性==>高级系统设置==>环境变量==>系统变量==>path==>
(正常情况下安装完成后系统会帮我们自动配置好)
5.在vscode 中配置
1.找到 配置文件setting.json
点击 查看==>输入setting ==>选中打开 setting.json
2.配置 exe 文件路径(分段符号 , 千万别漏 红色标记)
,
"code-runner.executorMap": {
// "javascript": "node",
"php": "D:\\BtSoft\\php\\73\\php.exe",
// "python": "python",
"bash" : "D:\\GIT\\Git\\git-bash.exe",
"perl": "perl",
"ruby": "C:\\Ruby23-x64\\bin\\ruby.exe",
"go": "go run",
"html": "\"C:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe\"",
"java": "cd $dir && javac $fileName && java $fileNameWithoutExt",
"c": "cd $dir && gcc $fileName -o $fileNameWithoutExt && $dir$fileNameWithoutExt"
},
"code-runner.languageIdToFileExtensionMap": {
"bat": ".bat",
"powershell": ".ps1",
"typescript": ".ts",
"git-bash": ".sh",
"/bin/git-bash": ".sh"
},
"code-runner.runInTerminal": true,
"terminal.integrated.shell.windows": "D:\\Program Files\\Git\\bin\\bash.exe"
6.新建 test111.sh 文件 在 vscode 中运行看是否正常执行
(在vscode 文件中打开 test111.sh 右键 run code )
正常运行能生成 e.txt 文件
#!/bin/bash
echo "Hello World !"
touch e.txt