.gitignore without ignoring file names with spaces in them on `git status`

When I do git status , I get:

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

But in my .gitignore I have:

 *.lnk 

What's going on here? Could this be a problem with spaces?

+1
source share
2 answers

So my problem is that the files are already in the repository, so adding a template to .gitignore did not stop git from tracking changes to them.

Is required

git update-index --assume-unchanged <file>

Now their changes are no longer tracked.

Else as ansh0l pointed out that git handles spaces perfectly.

+1
source

The problem is not spaces.

I think the file is already being tracked in your git repository, 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 will not delete the .lnk file, but it should not be checked locally (although it will be deleted on other people's computers after this commit is directed up)

+7
source

Source: https://habr.com/ru/post/1266522/


All Articles