Move the while loop later in the file and ignore `.git` folder from the debug output