Hedge Hedge - 8 months ago 91
Git Question

.dockerignore all subfolders but not files in the folder itself

I've got a folder structure like below. I want to ignore all subfolders (and all their content) of

but include all files which are directly in
(e.g. FETCH_HEAD and HEAD).

How do I write that in the

├── HEAD
├── description
├── hooks
│   ├── applypatch-msg.sample
│   ├── commit-msg.sample
│   ├── post-update.sample
│   ├── pre-applypatch.sample

qzb qzb

According to documentation you can ignore only subdirectories:


You don't have to manually exclude files which are directly in .git directory.