Julen Julen - 26 days ago 10
Git Question

gitignore - Ignore all file types except specified ones

I only want to commit files which extension is

.fmb
,
.fmx
and
.pll
, but I can't configure
.gitignore
file to achieve this.

I've tried with the following:

!.fmb
!.fmx
!.pll


and also with:

!*.fmb
!*.fmx
!*.pll


but it doesn't work.

Answer Source

Try this in your gitignore file-

* !*.fmb !*.fmx !*.pll

You will want to first ignore everything and then whitelist files.