git bash shell on Windows “Your edited hunk does not apply”

最后都变了- 提交于 2019-12-06 16:56:05
VonC

First, set git --global core.autocrlf to false.
Then clone again your repo, and check the value of core.autocrlf:

cd /path/to/new/clone
git config core.autocrlf

(no --global)

Finally, try again your git add -p (after reporting your modification in your new working tree).

Regarding hunk management, see also "Unexpected result in git-diff".


"Your edited hunk does not apply".

diff --git a/<file-a> b/<file-b> > 
index <short-hash-a>..<short-hash-b> 100644 
--- a/<file-a> 
+++ b/<file-b>
<changes>

If there was no changes (only in permission), adding a "patch" in that case does not make sense: you just git add the file (no -p)

But if there are changes, the question the OP mentioned "git add --interactive “Your edited hunk does not apply”" remains the reference.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!