我在寫一個bash腳本來添加,提交,推送目錄中的所有文件。Git commit bash腳本
#!/bin/bash
git add .
read -p "Commit description: " desc
git commit -m $desc
git push origin master
,我發現了以下錯誤:
$ ./togithub
Commit description:
test commit script
error: pathspec 'commit' did not match any file(s) known to git.
error: pathspec 'script"' did not match any file(s) known to git.
Everything up-to-date
我不知道這是否與閱讀文本的一個問題(它echo
沒事),或者將它傳遞給git commit -m
。
「做適當的引用」永遠不會被誇大。太多的次級「howtos」和半正確的建議/示例在網絡上... –