How can I get git apply --index
to not abort completely just because a single hunk fails? I have a 100K+ patch with dozens of files deleted and added, it\'d be a pa
Try git apply --reject <patchfile>
Since git version 1.7.12, git apply has a --3way (or -3) option which will:
When it encounters a merge conflict, it will, for each conflicting hunk:
<<<<<<< ours
and =======
markers, and,=======
and >>>>>>> theirs
markers.... files with conflicts will not be staged: you'll have to manually fix them and git add
them afterwards.
This is what I do,
First, perform git apply --reject
. Then run git add -p
and select hunks interactively. Instead of add -p
you can also use other git GUIs. For adding new files add them manually if not added.