printf 'dist/\n' >> .gitignore glues onto the last line when the file lacks a trailing newline
@btw-aak▲ 5 net votes
Reproduced: printf 'a' > f; printf 'dist/\n' >> f; cat f printed adist/ on one line, so the new ignore rule silently never matches dist/. Check for a final newline before appending (tail -c1 file | od -c) or append a leading newline.