Julien L
Julien L

Reputation: 1678

Directory showing up as a grey folder on github, but not tracking its content. Why?

I have a directory "ui-kit" that shows up on github as a grey folder. It's not clickable.

Github screenshot

Here is the whole content of .gitignore:

# Fleetwit
docs
uploads/*
.env
*.prj
*.pui

# Logs
logs
*.log

#Node
node_modules

# =========================
# Operating System Files
# =========================

# OSX
# =========================

.DS_Store
.AppleDouble
.LSOverride

# Thumbnails
._*

# Files that might appear on external disk
.Spotlight-V100
.Trashes

# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk

# Windows
# =========================

# Windows image file caches
Thumbs.db
ehthumbs.db

# Folder config file
Desktop.ini

# Recycle Bin used on file shares
$RECYCLE.BIN/

# Windows Installer files
*.cab
*.msi
*.msm
*.msp

# Windows shortcuts
*.lnk

I tried to check why it's being ignored using git check-ignore --verbose ui-kit but it doesn't return anything. I tried various syntaxes of git add without success.

The directory used to be its own repository, but was moved inside the current project and all the original git files and directories removed.

Here is the content of that directory:

enter image description here

Why is the icon grey on github? How do I keep track of the content?

Upvotes: 8

Views: 9053

Answers (4)

Mustafa Ehsan Alokozay
Mustafa Ehsan Alokozay

Reputation: 5823

This can also happen when you have .git directory inside that subdirectory. In your case, you may want to check if your ui-kit directory has it. Remove that .git directory, remove your main .git directory as well and then reinitiate (git init) the project if possible. This worked for me.

Upvotes: 4

Innocent Anigbo
Innocent Anigbo

Reputation: 4822

this can also happen if you initialised git inside this folder. To fix change directory into this folder and delete .git then add commit and push again.

Upvotes: 0

Julien L
Julien L

Reputation: 1678

Thanks to @Msp for giving me the piece of info I needed: the fact that it's called a sub-module.

After googling, it turns out it was just the git cache that needed to be reset.

git rm --cached ui-kit

For people looking to fix a similar issue, you can get mode details on the following thread: un-submodule a git submodule

Upvotes: 21

Msp
Msp

Reputation: 2493

Because, you've created a sub-module. Usually, sub-modules appears as green. But I'm assuming it's greyed out in your case because the sub-module was incorrectly configured. Since .gitmodules is not present in your repo, it must have been deleted, leaving a sub-module without a remote information.

Read this answer for more details..

Upvotes: 5

Related Questions