Grunt:.git/index.lock 运行 grunt-gh-pages 时文件存在错误

Grunt: .git/index.lock File exists error when running grunt-gh-pages

当 运行ning grunt-gh-pagesgrunt 时,它在任务中间失败,错误为

Warning: fatal: Unable to create '/home/richard/src/tumblr-argument-generator/.git/index.lock': File exists.

If no other git process is currently running, this probably means a git process crashed in this repository earlier. Make sure no other git process is running and remove the file manually to continue. Use --force to continue.

Aborted due to warnings.

我尝试使用 sudo rm -f ./.git/index.lock 删除文件(错误仍然存​​在),我尝试删除 gh-pages 分支 + 删除 index.lock 但仍然出现错误,我尝试删除我的文件 + p运行ing Github 上的 gh-pages 分支 + 并从 Github 重新下载新副本(同样的错误)。

如何正确地将 grunt-gh-pages 转换为 运行?

我找到了解决方案。线索是 .grunt 文件夹包含一个 grunt-gh-pages 子文件夹。

删除 .grunt 文件夹修复了所有 .git/index.lock': File exists 错误!