【发布时间】:2020-03-12 15:43:25
【问题描述】:
我正在尝试为一些基本的 git 操作编写脚本,因为遇到问题git status: command not found
我正在试穿:
- Windows 机器
- bash 脚本
- 从git bash运行脚本
- git 安装在C:\Program Files\Git\mingw64\bin
下面是我正在尝试的示例脚本:
path_to_git='/c/Program Files/Git/mingw64/bin/'
PATH=$PATH:$path_to_git
echo $PATH
export PATH
res=$("git status")
echo $res
请指导我,谢谢
【问题讨论】:
-
这里为什么要用双引号:
res=$("git status")? -
你拯救了我的一天,感谢您的指导。