【发布时间】:2020-08-01 13:44:33
【问题描述】:
我想用git来备份一些重要的数据。为此,我制作了这个脚本(使用 ssh 进行身份验证,因此不需要插入我的凭据)。
cd /media/patrick/Data
/usr/bin/inotifywait -m /media/patrick/Data -e create -e move -e modify -e delete |
while read path action file; do
git add *
git commit -m ‘”$(date)” file “$file” appeared in the directory “$path” via “$action”’
git push -u origin master
done
但这不起作用,似乎 git 试图添加提交消息中的内容。 我收到此错误:
error: pathspec '31' did not match any file(s) known to git
error: pathspec 'Jul' did not match any file(s) known to git
error: pathspec '2020' did not match any file(s) known to git
error: pathspec '07:57:58' did not match any file(s) known to git
error: pathspec 'PM' did not match any file(s) known to git
error: pathspec 'CEST”' did not match any file(s) known to git
error: pathspec 'file' did not match any file(s) known to git
error: pathspec '“test”' did not match any file(s) known to git
error: pathspec 'in' did not match any file(s) known to git
error: pathspec 'the' did not match any file(s) known to git
error: pathspec 'directory' did not match any file(s) known to git
error: pathspec '“/media/patrick/Data/”' did not match any file(s) known to git
error: pathspec 'modified/created/removed' did not match any file(s) known to git
error: pathspec 'via' did not match any file(s) known to git
error: pathspec '“MOVED_FROM”’' did not match any file(s) known to git
Branch 'master' set up to track remote branch 'master' from 'origin'.
Everything up-to-date
不知道原因,对不起,我不习惯壳。谢谢。
【问题讨论】: