There is a project without .gitignore there are several independent modules. In fact, there are several microservice projects that I want to put in one repository. But git instead of projects sees empty folders, and even more strangely adds them as empty folders. Here is how git interprets it: https://github.com/triodjangopiter/jhipster-microservices

What's happening? And how do I still pour all this into the repository.

These are real files.

 $ git status On branch master Your branch is up-to-date with 'origin/master'. nothing to commit, working tree clean 
  • What does git status say? - selya
  • @selya says everything is clear - updated the question. - Pavel
  • Strange ... Is it only in a githaba, or does it behave similarly on LAN? Are the files all tracked? Here, I found a similar topic - selya

1 answer 1

What's happening? And how do I still pour all this into the repository.

what is even stranger is adding them as empty folders

The author created submodules like this:

 $ git submodule add url-хранилища каталог 

each such command adds key information (including, in particular, the repository url) to the .gitmodules file.

I added the directories with submodules to my repository, but unfortunately the .gitmodules file is not.


The easiest way is to create a new empty repository and fill it as you need.

but if you really want to work with the mentioned storage, then you need to either create a valid .gitmodules file, or delete these four submodules.

the first way is to create . You will need the URLs of those repositories that the author added. The .gitmodules file should look something like this (one blog submodule is given, describe the other submodules in the same way):

 [submodule "blog"] path=blog url=сюда впишите url хранилища, которое задумал поместить сюда автор 

after this, the submodules will need to be initialized:

 $ git submodule update --init 

the second way is to delete . the .gitmodules file .gitmodules also have to be created, but in the deletion version, you can .gitmodules (an example is given for only one submodule, add the rest by analogy):

 [submodule "blog"] path=blog 

Now submodules can be initialized:

 $ git submodule deinit -f --all 

delete the unnecessary .gitmodules file:

 $ rm .gitmodules 

and remove directories from storage:

 $ git rm blog ... 

after which this change should be committed:

 $ git commit -m "remove submodules"