Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

.gitignore not ignoring filenames with spaces in them on `git status`

Tags:

git

gitignore

When I do a git status I get:

#       modified:   COM/config/Config/Edit Project Settings.lnk

But in my .gitignore I have:

*.lnk

What is going on here? Could it be a problem with whitespaces?

like image 490
RedX Avatar asked Nov 21 '25 16:11

RedX


1 Answers

The problem is not with the whitespaces.

I think the file is already tracked in your git repo, so you can remove it from the repo using the following:

git rm -r --cached "COM/config/Config/Edit Project Settings.lnk"
git commit -m "removed .lnk"

This won't delete the .lnk file, only untrack it locally (Though it will delete on other folks machines once this commit goes upstream)

like image 63
Anshul Goyal Avatar answered Nov 23 '25 06:11

Anshul Goyal



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!