hexo博客目录使用了git进行备份,但
在提交新的md文档时,提示
1 | $ git commit -m "备份" . |
查询别的教程,提示说因为themes/next
目录也是git仓库,删除其目录下的.git
文件夹就行,但是我之前已经删除了,所以只能另辟蹊径,提交时指定文件。
1 | git commit -m "备份" source/_posts/文档.md |
或者指定目录
1 | git commit -m "备份" source/* |
即可成功,如果你接着提示
1 | error: pathspec 'source/_posts/文档' did not match any file(s) known to git |
看看你添加source/_posts/文档
到暂存区了吗
使用git status
如果文件名是红色那就说明没有,先git add .
填加到暂存区。