how to exclude untracked files in git code example Example 1: how to remove untracked files in git git clean -fd Example 2: git remove Untracked files git clean -f