O
O
Ord EO2019-04-30 16:19:45
git
Ord EO, 2019-04-30 16:19:45

How to add the contents of a folder to .gitignore without adding the folder itself?

There is a folder in which the files generated by the application are stored, it is necessary that these files are not displayed in the repository, and the folder itself, even if there are no files yet, was visible in the repository, how can this be done?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Arthur, 2019-05-09
@ArturF

You can use an empty .gitkeep file, in which case your .gitignore will look something like this:

/path/to/folder/*
!/path/to/folder/.gitkeep

D
Dmitry, 2019-05-13
@dlnsk

Put .gitignore in this folder.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question