错误如下:
$ 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