Nick
Nick

Reputation: 2682

git doesn't ignore file while it matches with a wildcard in gitignore

I have a gitignore line like this

*.user # Qt Creator backup files

... and it doesn't match CMakeLists.txt.user! How come?

Upvotes: 0

Views: 201

Answers (1)

Nick
Nick

Reputation: 2682

That is because the line # Qt Creator backup files isn't a comment, only lines starting with a # are a comment, as in the manual

A line starting with # serves as a comment.

So the line *.user # Foo tries to match a file with exactly *.user # Foo, not *.user

Upvotes: 2

Related Questions