We have a folder tree with about 1,000+ xml files at various levels of depth. (the contain game configuration parameters from a 3rd party program).
We have edited about 10 of the files, and want to have a repository that we can fetch (via git clone) so we can overlay our changes on top of a native folder tree.
This is almost working.
Followed the advice in: .gitignore exclude folder but include specific subfolder
What we have done is put .gitignore patters (file globbing) for our windows based tree in to ignore some of the top level folders. E.g
/Scenarios/**
/Model/**
/Directives/**
/ContactReports/**
/Behaviors/**
/PlayerTemplates/**
/PlayerComponents/**
Then later we are trying to add back in some files (which can be done by git add -f , but we would prefer a .gitignore solution).
patterns like:
!/Behaviors/BasilanWP.bgf
!/Behaviors/BasilanFull.bgf
work fine since they are at the top level of the folder tree.
But patterns like the following (at the subfolder level) are still being ignored
!/PlayerTemplates/Weapon/Air_to_Surface/AGM65E.xml
!/PlayerTemplates/Air/Fighter/F-15.xml
I was asked to see if this is a lower/upper case issue unique to windows. Here is the output of git ls-files after we manually forced the files with git add -f
D:\Source\NGTS Scenario>git ls-files
.gitignore
Behaviors/BasilanFly.bgf
Behaviors/BasilanFull.bgf
Behaviors/BasilanJSOW.bgf
Behaviors/BasilanWP.bgf
Behaviors/JSOWBehavior.bgf
Behaviors/LMBCommandPost.bgf
Behaviors/Macros/FlyWaypoint.bgf
Behaviors/MaverickToPoint.bgf
Directives/JSOWDirective.dgf
Directives/MaverickDirective.dgf
PlayerComponents/Weapon/Air-to-Surface/AGM-65E.xml
PlayerComponents/Weapon/Air-to-Surface/AGM-DraperMaverick.xml
PlayerTemplates/Air/Fighter/F-15.xml
PlayerTemplates/Weapon/Air_to_Surface/AGM65E.xml
README.md
Scenarios/Basilan.nscen
Scenarios/BasilanFullJSOW.nscen
Scenarios/BasilanJSOW.nscen
Scenarios/BasilanMacrosWP.nscen
Scenarios/BasilanSOW.nscen
Full .gitignore
/jammers_extra.xml
/sensors_extra_b1.xml
/sensors_extra_b52.xml
/sensors_extra_cafdmo.xml
/sensors_extra.xml
/trafficConfig.xml
/TXA/**
/TacticalVariableGroups/**
/Scenarios/**
/Model/**
/Directives/**
/ContactReports/**
/Behaviors/**
/PlayerTemplates/**
/PlayerComponents/**
!/Behaviors/BasilanWP.bgf
!/Behaviors/BasilanFull.bgf
!/Behaviors/Macros/FlyWaypoint.b
!/Behaviors/BasilanJSOW.bgf
!/Behaviors/BasilanFly.bgf
!/Behaviors/JSOWBehavior.bgf
!/Behaviors/LMBCommandPost.bgf
!/Directives/JSOWDirective.dgf
!/Directives/MaverickDirective.dgf
!/Scenarios/BasilanFullJSOW.nscen
!/Scenarios/BasilanMacrosWP.nscen
!/Scenarios/Basilan.nscen
!/Scenarios/BasilanSOW.nscen
!/Scenarios/BasilanJSOW.nscen
!/Behaviors/MaverickToPoint.bgf
!/PlayerTemplates/Weapon/Air_to_Surface/AGM65E.xml
!/PlayerTemplates/Air/Fighter/F-15.xml
!/PlayerComponents/Weapon/Air-to-Surface/AGM-DraperMaverick.xml
!/PlayerComponents/Weapon/Air-to-Surface/AGM-65E.xml
UPDATE
I have tried a slightly different paradigm and it seems to work better, I also include re-include the relevant folder and not just the file. Which is why this is a different question than: .gitignore exclude folder but include specific subfolder
!/Behaviors/Macros/**
!/Behaviors/Macros/FlyWaypoint.bgf
and
!/PlayerTemplates/Weapon/**
!/PlayerTemplates/Air/**
!/PlayerComponents/Weapon/**
!/PlayerTemplates/Weapon/Air_to_Surface/AGM65E.xml
!/PlayerTemplates/Air/Fighter/F-15.xml
!/PlayerComponents/Weapon/Air-to-Surface/AGM-DraperMaverick.xml
!/PlayerComponents/Weapon/Air-to-Surface/AGM-65E.xml
But I cannot tell if this is due to the forced add, or not.