How to remove from Git a file that was crawled and is now in .gitignore?

2

I have a file that was crawled by git , but now it is in the .gitignore list.

However, this file still displays in git status when it changes.

What do I do to make sure% can completely forget this file?

    
asked by anonymous 04.04.2017 / 14:33

1 answer

1

If they are correctly in the .gitignore list, the following commands clean those files / directories.

For security you should first confirm with the flag -n !!

Clear files that are not indexed in .gitignore

git clean -n -xf

Se correcto então:

git clean -xf

Delete folders that are not in index / existing in .gitignore

git clean -n -df

Se correcto então:

git clean -df
    
04.04.2017 / 14:41