error 'themes/next' does not have a commit checked out

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

2021-05-20 18:37:46 更新