git - gitignore everything except specific files -


i've been reading on stack overflow using gitignore ignore except specific files. i've tried bunch of different suggestions, can't work me.

here's i'm trying do: want exclude except 1 file in main directory , couple other files in subdirectory. so, want these files:

flightsofideas.rb /flightsofideas/svgexporttools.rb /flightsofideas/svgexport.rb 

my latest version of gitignore is:

*     !flightsofideas.rb !/flightsofideas/svgexporttools.rb !/flightsofideas/svgexport.rb 

but git includes flightsofideas.rb, doesn't files in subdirectory.

you should add !*/ not ignore directories, or not directories include files.

still similar problem what's difference between git ignoring directory , directory/*?.

* !*/ !/flightsofideas.rb !/flightsofideas/svgexporttools.rb !/flightsofideas/svgexport.rb 

Comments

Popular posts from this blog

c# - Unity IoC Lifetime per HttpRequest for UserStore -

Change the color of an oval at click in Java AWT -

I am trying to solve the error message 'incompatible ranks 0 and 1 in assignment' in a fortran 95 program. -