github remove command code example Example 1: git remove cached directory git rm -r --cached [directory] Example 2: git remove all pdf files git rm -r */*.pdf