[英]"-bash: [git: command not found " in bash script on mac
我正在創建一個 bash 腳本來執行 git 命令。 在一個函數中,我在 git status 上使用 if 語句:
if [[ `git status --porcelain` ]]; then
echo "has change"
else
echo "no"
fi
然后它給出了這個錯誤:
-bash: [git: command not found
git 在命令行中工作得很好。 在沒有 if 語句的情況下,它在我的其他函數中也能正常工作。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.