I want git to keep track certain files only, so i wrote this gitignore file. In this file i tell git to ignore all the files except .ps1,.bat,.sql and .tab.I placed this gitignore file in root local working directory. Now the problem was, if the keep track files in subdirectory (BatchFile subdirectory), git will ignore them which i believed due to * . How to correct it ?
*
!*.ps1
!*.bat
!*.sql
!*.tab
My folder directory structure
Main
BatchFile
DB_Objects
Table
View
and etc..