I have a very frustrating error when trying to manually edit hunks while using the command:
git add -p
I have already looked through many of the existing questions on this site, including this one, and this one.
I am at the point where I try to manually edit a hunk, make no changes to the file opened by git for manual editing, and still getting the error "Your edited hunk does not apply".
I thought this might have to do with CRLF vs. LF EOL characters. I am editing in Notepad++, and I can see that all of my line endings are CRLF. I naively tried to change all the line endings to LF, but to no avail.
I can also see that all context lines have leading spaces, so that isn't the issue either. Furthermore, I have:
git --global core.autocrlf
set to true
.
Any help is greatly appreciated.
Edit: According to VonC's answer, in my specific case I have a permission + content diff. Does this still mean I cannot do:
git add -p
If it were only a permission diff, I understand why this wouldn't be necessary, and the interactive option must be dropped; but in this case, is there a way to still do an interactive add
?