今天在提交git新仓库的时候,遇到这个报错。 我直接先用的git add . 于是就报这个错了! 解决办法:先git init 然后再git add .成功! 资料: https://blog.csdn.net/wenb1bai/article/details/89363588