Get the latest tech news
The Art of Manually Editing Hunks
How to edit hunk diffs
Saving and closing the editor now, Git will have staged the desired diff. Notice, the hunk context data was updated correctly to match the new changes. For example, in Elixir quicksort example we have just did, if we entirely removed the second- from the diff and manually updated the hunk header, the patch will never apply cleanly.
Or read this on Hacker News