How to add folders and subfolders in existing project in Git




How to add multiple folders in GIT.

something like this,

I have git repo as below


–> .git

–> folder1

 -->subfolder1 --> files


--> subfolder2 

      subfolder21 --> files(1--n)

and I want add multiple new folders

–> .git

–> folder1

 -->subfolder1 --> files


--> subfolder2 

      subfolder21 --> files(1--n)


** -->newSubFolder1 --> files(1…N)**


** -->newSubFolder2**

** -->newSubFolder21 --> files(1…N)**

The ones shaded in bold italics are similar folder structure need to be added it will have multiple folders with multiple files in it.

When I copy the folder the ‘git status’ doesn’t show any new folders added. git add -A doesn’t help.

Please let me how to add folders and subfolders with files within it.



What you do looks alright to me… what is in your .gitignore?


You can find Git resources here:


There is no .gitignore file.


Are there already files in the folders you’ld like to add?

Git works on files only, not on directories!


Yes, there are files in sub-folders that need to be added. There are sub-folders within multiple folders, that need to be added. And all folders will have files or folders inside it.


Somehow this structure doesn’t look like a Kirby project at all?


Thanks Bart and Sonja for your prompt responses. This is a requirement to add the sub-folders and folders with files… without have .git files within this folders. I haven’t come across this kind of scenario anytime. So I am looking into the possibilities to know if this is possible and how it can be done.


Ah yes. AFAIK only folders added by git submodule have a .git file in it.