Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

git clean isn't cleaning hidden files

Tags:

git

I have 3 untracked files in my working directory:

$ git sta
## features/subchecks...upstream/BR_4_1_4 [ahead 4]
?? Applications/ETM/Build/Android/.project
?? Applications/zFacebook/Build/Android/.project
?? Core/Barcode/Build/Android/.project

I do a dry run of git clean like so:

$ git clean -n

But it's not showing any files will be cleaned. Why is it not cleaning the .project files? I'm using msysgit 1.9.2 on Windows.

like image 735
void.pointer Avatar asked Oct 23 '25 19:10

void.pointer


1 Answers

To put the tree back into a fully clean slate and get rid of everything locally that is not tracked by git, do the following:

git clean -fdx

If you want to keep files that are ignored by git (i.e. files in .gitignore) then leave the "x" off.

like image 63
Jeff Scott Brown Avatar answered Oct 26 '25 08:10

Jeff Scott Brown