Black
Black

Reputation: 20252

gitignore fails to ignore files/folders with whitespaces

This is my .gitignore file:

Textfusion\ Pro/bin/Debug/
Textfusion\ Pro/bin/Release/
.gitignore
.vs/

But If I execute git status then the folder is still appearing.

t

I also tried it like this:

Upvotes: 1

Views: 1597

Answers (1)

Robin Green
Robin Green

Reputation: 33063

Your files are already in the repository. You have to git rm them (note that you should specify the --cached option to git rm if you don't want them to be deleted). After that, they should be ignored if you write it like Textfusion Pro/bin/Release/ in the .gitignore file.

Note that even after you do that and commit, they will still be in the repository history, taking up space. There are questions on Stackoverflow that explain how to rewrite the git history.

Upvotes: 3

Related Questions