我有这样一个git目录
.
|-- README
`-- template
...`-- compiled
........|-- admin
........|...|-- haha
........|...`-- index.html
........|-- haha
........`-- index.html
现在需要把template这个目录里除了两个index.html外都忽略掉
master* $ cat .gitignore
template/compiled/*
!template/compiled/index.html
!template/compiled/admin/index.html
上面那样写的话template/compiled/admin/index.html这个文件还是会被忽略掉
请教各位正确的写法
.
|-- README
`-- template
...`-- compiled
........|-- admin
........|...|-- haha
........|...`-- index.html
........|-- haha
........`-- index.html
现在需要把template这个目录里除了两个index.html外都忽略掉
master* $ cat .gitignore
template/compiled/*
!template/compiled/index.html
!template/compiled/admin/index.html
上面那样写的话template/compiled/admin/index.html这个文件还是会被忽略掉
请教各位正确的写法