Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Greyed out folder in GitHub repo?

Tags:

github

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
like image 482
Jack Sewell Avatar asked Feb 08 '23 05:02

Jack Sewell


1 Answers

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
like image 192
VonC Avatar answered Feb 14 '23 08:02

VonC