Problems with git format-patch/am (patch does not apply)

前端 未结 2 1040
囚心锁ツ
囚心锁ツ 2021-02-13 07:21

I am trying to apply a few patches to my repo, and getting message patch does not apply unless I specify params --ignore-space-change --ignore-whitespace

2条回答
  •  粉色の甜心
    2021-02-13 07:40

    Aha! Looks like I've found the reason. The repository uses CRLF line endings, but format-patch creates patch files with LF's. When I create a repo from scratch with autocrlf=false and make the same experiment, I have the same problem. (looks like a bug in Git)
    Any advise how to fix this?

    UPD my solution was to create a fresh repository with autocrlf=true and re-import all changes from both repositories into it.

提交回复
热议问题