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
Post a Comment