1. 程式人生 > >報錯 pathspec '–m' did not match any file(s) known to git.

報錯 pathspec '–m' did not match any file(s) known to git.

使用shell寫git commit -m命令報錯 pathspec '–m' did not match any file(s) known to git.

指令碼如下

cd /Users/Mark.W/Documents/AboutMyself/ 
git add .
git commit -m "add_upload_picture"
git push origin master

但是在命令列執行沒有問題。

最終發現是shell腳本里不用新增“”,去掉引號即可。還是對shell程式設計不熟悉。

修改後shell為:

cd /Users/Mark.W/Documents/AboutMyself/ 
git add
. git commit -m add_upload_picture git push origin master