L
L
lexnekr2015-01-21 15:03:40
git
lexnekr, 2015-01-21 15:03:40

.Gitignore - how to exclude a subfolder through one?

admin/*
!admin/modules/

Works
A
admin/*
!admin/modules/name/

Does not work.
Those. For some reason, Git needs to specify a rule to exclude from gitignore a folder nested immediately in the folder that is not indexed (and not in its child).
How to get around this without spawning multiple gitignore if you want to exclude:
the entire /admin/ folder, including /admin/modules/, except for /admin/modules/name/

Answer the question

In order to leave comments, you need to log in

1 answer(s)
L
lexnekr, 2015-01-21
@lexnekr

Found the solution myself.
1) exclude the folder
admin/*
2) ignore the exception of the child
!admin/modules/
3) exclude the contents of the child
admin/modules/*
4) ignore the exception of the child
!admin/modules/name/
TOTAL:
admin/*
!admin/modules/
admin/modules/*
!admin/modules/name/

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question