how to ignore a directory in git rm cached code example Example: git remove cached directory git rm -r --cached [directory]