Applying a diff file with git

后端 未结 6 1734
一个人的身影
一个人的身影 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:12

    You will have to check if you still see the error message bad git-diff - expected /dev/null on line 47 after Git 2.17 (Q2 2018).

    Many places in "git apply" knew that "/dev/null" that signals "there is no such file on this side of the diff" can be followed by whitespace and garbage when parsing a patch, except for one, which made an otherwise valid patch (e.g. ones from subversion) rejected.

    See commit e454ad4 (15 Feb 2018) by Tatyana Krasnukha (tkrasnukha).
    See commit f16ef7b (15 Feb 2018) by Johannes Schindelin (dscho).
    (Merged by Junio C Hamano -- gitster -- in commit 177bd65, 28 Feb 2018)

    See also git-for-windows/git issue 1489

    apply: handle Subversion diffs with /dev/null gracefully

    Subversion generates diffs that can contain lines like this one:

    --- /dev/null (nonexistent)

    Let's teach Git's apply machinery to handle such a line gracefully.

提交回复
热议问题