When I copy a file over top of another file in a git controlled directory... I'm seeing git think that the whole file has changed instead of one small hunk... why?
Here is an example of what I mean... http://github.com/cmodien/fileupdatetest/commit/90309ed099e257cd98218b4504cd2cd3a3a47a27
OK... I checked the line endings on the file... The original file has crlf line endings. The file that I pasted over the original has lf line endings. Which makes sense I guess... I got the original file from a windows user and I received the new file from a mac user.
How do I fix this?
As mentioned on twitter, (@adymitruk) you have an issue with line endings. The AutoCRLF setting is probably not set to "false" as it should be - unless you are doing cross-platform development.
The solution is to set it to false, fix the line endings set the autocrlf to false then commit. When this is done, you will be able to copy those files and then only see the actual changes.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With