今天提交文件到github,步驟是:html
在第二步是,出現錯誤,錯誤以下:git
D:\tensorflow>git commit -m ' add codes for abc'
error: pathspec 'add' did not match any file(s) known to git.
error: pathspec 'codes' did not match any file(s) known to git.
error: pathspec 'for' did not match any file(s) known to git.
error: pathspec 'abc'' did not match any file(s) known to git.github
語法上沒有問題,老是提交不了,最後發現,在Linux系統中,commit信息使用單引號''包括,我使用的windows系統,信息應該是雙引號""包括,即第二步命令正確格式是git commit -m "add condes for abc"
windows
在分析上面問題的時候,發現了幾個有用的命令:編輯器
git commit --amendspa
git resetcode
git add
命令的執行,區別於git commit --amend
,該命令更傾向於取消上一次的暫存區提交,git commit --amend
更傾向於修改提交說明