Greyed out folder in GitHub repo?

前端 未结 2 1718
太阳男子
太阳男子 2021-02-10 16:38

Hey so I pushed a new folder to my GitHub repository and well it is greyed out. Why?

I\'m new to git and have probably done something to git to cause this so how can i s

2条回答
  •  囚心锁ツ
    2021-02-10 17:01

    A gray folder on GitHub looks like a submodule, as I mentioned in:

    • "What is this grey git icon?"
    • "What does a grey icon in remote GitHub mean"

    It is not a sub-folder, but a special entry in the index which marks it as a submodule-like.

    If you don't have a .gitmodules file in your main repo, that special entry is typical of adding a nested repo: check if your dist/ folder has itself a .git/ subfolder.

    To fix the issue, try a git rm --cached dist (no trailing slash).
    See more at "Cannot remove submodule from Git repo"

    git rm --cached dist
    git commit -m "Remove submodule entry"
    rm -Rf dist/.git # delete the nested repo
    git add dist
    git commit -m "Add dist plain subfolder"
    git push
    

提交回复
热议问题