git am error: “patch does not apply”

前端 未结 7 1974
醉话见心
醉话见心 2021-01-30 02:01

I am trying to move several commits from one project to the second, similar one, using git.

So I created a patch, containing 5 commits:

git format-patc         


        
相关标签:
7条回答
  • 2021-01-30 02:57

    git format-patch also has the -B flag.

    The description in the man page leaves much to be desired, but in simple language it's the threshold format-patch will abide to before doing a total re-write of the file (by a single deletion of everything old, followed by a single insertion of everything new).

    This proved very useful for me when manual editing was too cumbersome, and the source was more authoritative than my destination.

    An example:

    git format-patch -B10% --stdout my_tag_name > big_patch.patch
    git am -3 -i < big_patch.patch
    
    0 讨论(0)
提交回复
热议问题