All articles

Git ignores a freshly created .gitignore

A .gitignore created with echo on Windows seemed to be ignored – the culprit was a trailing space appended to every line.

Yesterday I created a new .gitignore on Windows using the following commands:

echo .* >> .gitignore
echo bin* >> .gitignore

Git simply ignored it – or so I thought. After a bit of searching I noticed that the command had appended a space to each of the lines. Once those were removed, everything worked as intended.