Jeong Jinmyeong
Jeong Jinmyeong

Reputation: 208

.gitignore doesn't ignore untracked files

I want to ignore untracked files shown below, but it keeps showing. I tried deleting cached files (git rm --cached CruiserConsole*.*) but it didn't work.

D:\Git\CruiseProtocolScripts [master +8 ~1 -0 !]> git status
# On branch master
# Untracked files:
#   (use "git add <file>..." to include in what will be committed)
#
#       CruiserConsole.exe
#       CruiserConsole.exe.config
#       CruiserConsole.pdb
#       CruiserConsole.vshost.exe
#       CruiserConsole.vshost.exe.config
#       CruiserConsole.vshost.exe.manifest
#       LuaInterface.dll
#       lua51.dll
nothing added to commit but untracked files present (use "git add" to track)
D:\Git\CruiseProtocolScripts [master +8 ~0 -0 !]> git rm --cached .\CruiserConsole.*
fatal: pathspec 'CruiserConsole.*' did not match any files

Here's my .gitignore file.

/CruiserConsole*.*
/*.dll

I guess I have improper pattern matching for file names, but I cannot point what's the exact problem.

Thank you in advance.

Upvotes: 1

Views: 511

Answers (2)

Kamil Domański
Kamil Domański

Reputation: 323

If I remember correctly, path slashes on Windows work the other way. Try changing these "/" to "\" or "\\".

Upvotes: 0

Mureinik
Mureinik

Reputation: 311308

You need to remove the / at the beginning of each line. Your .gitignore should look like:

CruiserConsole*.*
*.dll

Upvotes: 3

Related Questions