git help add

 

​-A, --all​


​Like -u, but match <filepattern> against files ​​​​in​​ ​​the working tree ​​​​in​​ ​​addition to the index. That means that it will ​​​​find​​ ​​new files as well as​​​​staging modified content and removing files that are no longer ​​​​in​​ ​​the working tree.​



也就是发现的所有新增、删除、修改的文件都不在working tree上, 就会working directory clean了。