GitHub folders have a white arrow on them

GitGithub

Git Problem Overview


I have recently pushed to github, and see a white arrow on one of my folders.

enter image description here

and when i click on the folder, it does not open it. On my local machine, it has contents, but in github i cannot access them. What does this mean?

Git Solutions


Solution 1 - Git

Symptom

Check if locally you have a .git/ sub-folder under that folder.

Cause

That would mean the folder (locally) is a nested Git repository, whose tree SHA1 is recorded as a "gitlink" (gray folder with straight white arrow)

What you would then see on GitHub is that gitlink: SHA-1 of the object refers to a commit in another repository, represented by an empty folder name. It is a nested Git repository.

If you see a folder @ xxx, then it is a submodule entry, meaning your own repository has a .gitmodules in it, which records, in addition of the gitlink, the actual URL of the remote repository.
It represents the object name of the commit that the super-project expects the nested submodule's working directory to be at.

In both cases (white arrow with a folder name, or white arrow with folder @ xxx, folder name and version), it is a Gitlink represented a nested Git repository: a placeholder for another Git repository, hence an empty folder. But in the second case, that empty folder would be referenced/visible in a special .gitmodules file.


Solution (to remove the white arrow)

In order to restore that folder content:

submodule:

A git clone --recurse-submodules would restore the content of that submodule in your local repository (as opposed to a nested Git repo, where its URL is not recorded, and the content of the folder would remain empty)

The white arrow would remain on the remote repository, with folder @ version displaying what SHA1 of the submodule repository is referenced by your project.

Nested Git repository:

Alternatively, you could, if you don't care about the history of that folder, delete locally its .git subfolder (assuming it is not a submodule, meaning it is not referenced in a .gitmodules file in your main repository), add, commit and push.
The white arrow would then disappear, and you would be able to access that folder content on GitHub.

Solution 2 - Git

The arrow may mean that is a submodule.

You could try:

git add yourfolder

If that results in an error like:

xxx submodule xxx

appears, you may try this:

git rm --cached yourfolder

Then, you could successfully run:

git add yourfolder

Solution 3 - Git

That can be because there's a hidden .git folder which causes the occurrence of white arrow, you can delete .git folder and push entire needed folder again to get rid of white arrow mark.

Solution 4 - Git

On your machine, if you navigated to the directory with the arrow and tried to view hidden files, you'd see a .git folder, indicating that it is a repository. This means that it is a repo contained inside the outer repo that you had pushed to GitHub. The easiest way to get rid of the arrow and start seeing your files properly (in my opinion) is by deleting the .git folder. That way, it ceases to become a git repo and is a regular folder once more. Now when you push to GitHub, you can normally access the folder and view all its contents.

Solution 5 - Git

If you want to remove a submodule from the git config files, Follow this, remember that if you DON'T want to delete the local directory of that submodule, DON'T do Step X:

Delete the relevant section from the .gitmodules file.

Stage the .gitmodules changes git add .gitmodules

Delete the relevant section from .git/config.

Run git rm --cached path_to_submodule (no trailing slash).

Run rm -rf .git/modules/path_to_submodule (no trailing slash).

Commit git commit -m "Removed submodule "

(Risky)Step X :- Delete the now untracked submodule files rm -rf path_to_submodule

Solution 6 - Git

In my case:

git rm --cached portal

ls 

git status

git add --all

...

enter image description here

Solution 7 - Git

I have the same issue. Then I realized inside that folder in my local machine, there is another .git folder and a .gitignore inside that inaccessible folder in my repository, so it's kind of like there is another repository inside my main repository. Then I removed those unwanted folder and file and pushed again new changes and It works for me.

Solution 8 - Git

I deleted the .git hidden folder both in the root and the submodule folders and pushed to a new repository and the arrow didn't appear.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionAnk i zleView Question on Stackoverflow
Solution 1 - GitVonCView Answer on Stackoverflow
Solution 2 - Gityunyi huView Answer on Stackoverflow
Solution 3 - GitShivam PaliyaView Answer on Stackoverflow
Solution 4 - Gitsanya29View Answer on Stackoverflow
Solution 5 - GitTaha AliView Answer on Stackoverflow
Solution 6 - GitConsuleView Answer on Stackoverflow
Solution 7 - GitThisara JayaweeraView Answer on Stackoverflow
Solution 8 - GitErez PeerView Answer on Stackoverflow