You'd list the file extensions you want to track? Here is an example for a PHP project:
* !/ !.php !.md !.xml !.gitignore !composer.json
Or Clojure:
* !/ !.clj !*.md target/ !.gitignore
If you have exceptions on these rules, you can always force-add the files or add the extension to .gitignore, to configure it not being ignored.