Greyed out folder in GitHub repo?

前端 未结 2 1733
太阳男子
太阳男子 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
    
    0 讨论(0)
  • 2021-02-10 17:08

    it looks like you have initialised git inside this folder. To fix change directory into this folder and delete .git then add commit and push again.

    0 讨论(0)
提交回复
热议问题