I want to find out what files in a certain directory are not managed by Git. This is so I because I use Git for backups, and I want to eventually get all my files personal in there.What unix tool could accomplish this? Is there a way to use find to do this in a reasonably efficient way?Example:I have a folder where I store RFC-related stuff, it looks like this:. TheFile tests     4180      data          bad          good              linebreaks.csv     get-rfc.sh     .git <contents omited>     LICENSE     README     rfc4180.txtI'm looking for a command that will output me:TheFile
List files not stored in Git repos
scripting;find;git
find the_starting_dir \( -type d -exec test -d '{}'/.git \; -prune \) -o -printNot the most portable of find invocations, but works with GNU find.Find walks the directory tree. The term -prune returns true but stops find from further processing the subtree. So the left hand side of the -o says if this is a directory, and if test says there is a sub-directory called .git and if prune returns true then we are done processing this thing in the tree. The right hand side says otherwise print itIf you don't want directories printed then change -print to \( ! -type d -print \) but then you will not get any indication about empty directories.You can change the -print to -ls to get listings, -printf see manual etc etc.