git add files报错does not have a commit checked out,fatal: adding files failed 原因:在files的子目录中还存在.git的隐藏文件,所以报错 解决办法:删除子目录.git即可