Search code examples
gitdirectory-structure

Install Directory Structure


I have a git repository that has a lot of ignored directories in it. However, when someone new downloads the repository, I want them to have the directory structure just not the files within it.

For example, my structure is

  • Data
    • Folder1
    • ...
    • Folder20

And I currently have a .gitignore with !.gitignore in Data. Is the best to create the structure to have a script in my repository that installs it?


Solution

    • Provide a script in your repository, like makedirs.sh and instruct the user to run that script after checking out the repository, in the README file. The script should take care to create the necessary structure.
    • Stop ignoring these directories, create a dummy file with a name like .empty or .placeholder or .donotremoveme etc, and add them all — this will ensure the directory structure is kept and checked out because the files are.