sometimes we need a local folder in our repos that we use to put in development content into, but this is content that we dont necessarily want to be commited to our git history, so one way to acoid these unwanted files is to use git ignore.
you need to ignore files and folders recursively:
/local/** (if you only ignore /foo/, that is the folder, then no amount of '!' exclusion rule will work, since the foo/ folder itself is ignored: Git will stop there)
Then exclude folders from the ignore rules:
!/local/**/ Before whitelisting files like the .gitkeep
!/local/**/.gitkeep That works because the .gitkeep parent folders are excluded from the ignore rules.
this trick will allow you to have a folder and subfolders that will not have any files when commited to the repo but still hold the structure for when you want to put in test files and do local development