Applying a diff file with git

后端 未结 6 1590
一个人的身影
一个人的身影 2021-02-18 20:50

So I was trying to use apply a diff file to my git dev branch. The diff I wanted to apply was this one here: https://github.com/mbabker/joomla-cms/compare/JHtml_move.patch

6条回答
  •  温柔的废话
    2021-02-18 21:36

    I had the same issue, but I was testing a patch I was going to send to a listserve, following the recommendations here: https://www.kernel.org/doc/Documentation/email-clients.txt . I couldn't just fix the problem on my local file, I needed to distribute a patch which was potentially going to be mangled by gmail and I was checking the gmailed version with git apply.

    My co-worker pointed out to me that

    git am 
    

    Is better than git apply at correcting for these sorts of problems and is what should be used with .patch files. This is mentioned in one of the comments above but it should be an answer.

提交回复
热议问题