解决git上传项目有文件夹无法打开情况

在码云上传文件夹出现以下情况
gitFolderError

git则显示文件夹为灰色

1
2
错误提示: 
1. Assertion failed(删除了.git但未执行后面的代码)

原因是因为文件夹内可能有其他git仓库的代码,里面有.git文件夹
解决方案:

  1. 删除.git文件夹
  2. 依次执行下面代码
    1
    2
    git rm --cached directory
    git add directory