Search code examples
gitcomposer-phptcpdf

Git treats folder as file and ignores all subfolders and -files


I'm having a strange issue with Git. I use Composer to include TCPDF in my application, but I can't get it added to my repository.

Here's what I do step-by-step:

enter image description here

The status quo. These are just plugins; it's lacking the 'tcpdf' folder I need.

Now I run Composer to have it install the additional directory.

enter image description here

In this picture, it's already clear that something is wrong. Composer downloaded all files and folders and TCPDF is functioning on my machine, but only the tcpdf folder is shown red. The subfolders are not! I go to the command line and do 'git add .', so that it adds all files and folders. Now it looks like this:

enter image description here

Still wrong.

The wrong status is reflected by git status:

enter image description here

I'm really stuck here. I have no idea how to tell Git that this isn't a file but a folder. My repo is perfect, but if my colleague updates he only gets this file, without the folder content.

How do I fix this?


Solution

  • No idea what was wrong, but I copied the entire contents of tcpdf to a new folder called test, committed that folder and its contents successfully, removed the tcpdf-'file', committed, then renamed the test-folder to tcpdf and committed again.

    Strange but all good now.