Answer the question
In order to leave comments, you need to log in
Ignore rules in .gitignore - how to preserve the structure of empty subfolders?
Let's say we have the following part of the project's file structure:
/files
/files/uploads
/files/users
.gitignore
/files/uploads
/files/users
/files/uploads/*
/files/users/*
/files/uploads/*
!/files/uploads
/files/users/*
!/files/users
Answer the question
In order to leave comments, you need to log in
Добавьте в эти папки пустой файл .gitkeep
Это не стандартный файл Git, но общепринятая практика.
Гит не отслеживает папки. Единственный вариант - класть туда пустые файлы.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question