git remove untracked files without deleting code example
Example 1: git remove untracked files
git clean -n
git clean -i
git clean -f
git clean -fd
git clean -fX
git clean -fx
Example 2: remove folder from repo but keep locally
git rm -r --cached File-or-FolderName
git commit -m "Removed folder from repository"
git push origin master
Example 3: how to remove untracked files in git
git clean -f
Example 4: git remove remote file keep local
git rm --cached myfile
git rm --cached --r myfile
Example 5: git abandon untracked files
git clean -i