I just found out that if you have a BOM (Byte Order Mark) in your file before a commit, and don't have one after it, then when you git diff the file before and after the commit, it will appear that the first line is both removed and added, but the removed line will have a mysterious space at the beginning. It turns out that that mysterious space is the BOM.