git add 文件出现的错误error: ‘xxx/‘ does not have a commit checked out 解决方法

Posted 茉莲晨曦

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了git add 文件出现的错误error: ‘xxx/‘ does not have a commit checked out 解决方法相关的知识,希望对你有一定的参考价值。

错误如下:

$ git add .
error: 'xxx/' does not have a commit checked out
fatal: adding files failed

原因是在 xxx/文件夹下有隐藏文件,删除掉即可

显示隐藏文件:
defaults write com.apple.finder AppleShowAllFiles -boolean true; killall Finder

取消显示隐藏文件:
defaults write com.apple.finder AppleShowAllFiles -boolean false ; killall Finder

以上是关于git add 文件出现的错误error: ‘xxx/‘ does not have a commit checked out 解决方法的主要内容,如果未能解决你的问题,请参考以下文章