git am error: “patch does not apply”

前端 未结 7 1976
醉话见心
醉话见心 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:55

    I faced same error. I reverted the commit version while creating patch. it worked as earlier patch was in reverse way.

    [mrdubey@SNF]$ git log 65f1d63 commit 65f1d6396315853f2b7070e0e6d99b116ba2b018 Author: Dubey Mritunjaykumar

    Date: Tue Jan 22 12:10:50 2019 +0530

    commit e377ab50081e3a8515a75a3f757d7c5c98a975c6 Author: Dubey Mritunjaykumar Date: Mon Jan 21 23:05:48 2019 +0530

    Earlier commad used: git diff new_commit_id..prev_commit_id > 1 diff

    Got error: patch failed: filename:40

    working one: git diff prev_commit_id..latest_commit_id > 1.diff

提交回复
热议问题