Somewhere in the forest that is git docs, I found this:
--untracked-files[=<mode>]
Show untracked files.
The mode parameter is optional (defaults to all), and is used to specify the handling of untracked files; when -u is not used, the default is normal, i.e. show untracked files and directories.
The possible options are:
no - Show no untracked files
normal - Shows untracked files and directories
all - Also shows individual files in untracked directories.
The default can be changed using the status.showUntrackedFiles configuration variable documented in git-config[1].
Maybe this will give you a list of things to exclude/delete for your script?
G