保持したいフォルダ構造を作成。ここでは/storage/フォルダ以下のフォルダ構造をgitで保持したいとする。 各末端のフォルダに空のファイル.gitkeepを作成。 .gitignoreに以下を書く。
.gitignore /storage/** !/storage/**/ /storage/**/.gitkeep
なるほど
(2022/06/20)