Greyed out folder in GitHub repo?

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 start from fresh?

Here's a link to my repo: https://github.com/ZoidinCode/ZoidinCode.github.io/tree/master/dist

I've uninstalled Git and then re-installed it and well this has happened :(

Git:

  cd desktop/Artificial-Reason-1.4.6
bash: cd: desktop/Artificial-Reason-1.4.6: No such file or directory

XXXX~/desktop/Artificial-Reason-1.4.6 (master)
$ git add dist/header_light_dark

XXXX ~/desktop/Artificial-Reason-1.4.6 (master)
$ git commit -m "First commit to GitHub"
[master 0e2035b] First commit to GitHub
 1 file changed, 1 insertion(+)
 create mode 160000 dist/header_light_dark

XXXX ~/desktop/Artificial-Reason-1.4.6 (master)
$ git push origin master
Counting objects: 1229, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (1223/1223), done.
Writing objects: 100% (1229/1229), 49.79 MiB | 443.00 KiB/s, done.
Total 1229 (delta 848), reused 0 (delta 0)
To https://github.com/ZoidinCode/ZoidinCode.github.io.git
 * [new branch]      master -> master

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
    

    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.

    链接地址: http://www.djcxy.com/p/92284.html

    上一篇: 什么会导致git中的子模块冲突,以及它们应该如何解决?

    下一篇: GitHub仓库中的文件夹变灰了?