Git exclude directories with a specific name except one
I've seen several questions that are similar to this and also read the gitignore manual , but still can't figure it out.
I want to exclude all named folders lib
(there is one for me "lib/"
), except for one folder (maybe in the future) which is a third party that I cannot change which is under <root>/3rdparty/projectX/lib/
.
I've tried this:
!lib/
lib/*
!projectX/lib/
but this also includes other lib folders that are not under root
Can I add this folder as an exception? as?
+3
source to share
1 answer