2

I was trying to add my OnlineStore folder to GitHub which has two main folders inside it. A ServerApp and a ClientApp. Not sure what I have done wrong that ClientApp folder looks like this and I can't even click on it to go inside.

This is also the actual link to it: https://github.com/BlakeAghili/OnlineStore

How can I fix this now? Thank you.

enter image description here

1 Answers1

2

TL;DR:

You just get this “right arrow in a folder” icon in GitHub because you happen to commit the ./ClientApp directory although it was itself a Git repository (i.e., containing a ./ClientApp/.git directory, which means that a shell command such as cd ClientApp && git status would work).

As a result, the ClientApp sub-directory is seen by Git/GitHub as a so-called git submodule, as shown by the following URL and screenshot:

https://github.com/BlakeAghili/OnlineStore/commit/ff0e522#diff-6ee288c5ef71eb1fd24077fc2aadab3d

GitHub Submodule

What to do now?

You might not want to keep this git-submodule in your history, and commit its contents instead? In this case, you could either:

  • follow this SO answer: How do I remove a submodule?
    (note that the procedure is a bit tricky, as usual when it comes to using submodules; and you should probably do a backup of all your project code beforehand, just in case);

  • or more simply and also more aggressively, restart your main project history, doing something like this SO answer: Make the current commit the only (initial) commit in a Git repository?,
    maybe after moving away (not deleting) the history of your ClientApp folder that you might want to keep as well − mv ClientApp/.git ../ClientApp.backup.git

matt
  • 515,959
  • 87
  • 875
  • 1,141
ErikMD
  • 13,377
  • 3
  • 35
  • 71