git clean directories in untracked files
How can I remove directories from untracked files that aren’t appearing in
git clean -n? Here are my steps:
- git status says up-to-date with remote even though it's not
- Git: How to find whether origin/master is equivalent of (local) master?
- When running git status the message "your branch is up-to-date with 'origin/branch' only appears some times
- How can I run 'git diff some/long/file/name' without typing the full path?
- Git model for website development with Bitbucket
- “git status” in brief or short format like “ls -1”?
Untracked files: (use "git add <file>..." to include in what will be committed) css/ ../../../../../../../../site-testing/lru-cache/
I get no results from
git clean -n (or
git clean --dry-run).
How can I remove these directories from appearing in untracked files?
4 Solutions collect form web for “git clean directories in untracked files”
You need to add them to a .gitignore file
if you want to delete all the files, which are not controlled by git, use
git clean -d -f -x
if you want to ignore them — use
.gitignore file as @tom.alexander suggests.
git clean -xdf
It restores your directory (and sub-directories) to pristine condition.
git clean operates recursively from the current working directory. Try moving to a parent directory of your working copy and invoking it from there:
cd ../../../../../../../../ git clean -n