Manual hunk editing in git interactive mode

Posted by kRON on Stack Overflow See other posts from Stack Overflow or by kRON
Published on 2010-05-25T14:19:07Z Indexed on 2010/05/25 14:21 UTC
Read the original article Hit count: 365

In manual hunk edit mode, the docs say this:

# To remove '-' lines, make them ' ' lines (context).
# To remove '+' lines, delete them.
# Lines starting with # will be removed.

What I don't understand is how to remove '-' lines.

Say if I had had this bit of code:

Alfa
Bejta

And I've edited it in my working tree to:

Alpha
Beta

The diff is:

- Alfa
- Bejta
+ Alpha
+ Beta

How do I edit the hunk to only commit the modifications to the first line?

I've tried these:

- Alfa
  Bejta
+ Alpha

- Alfa
+ Alpha
  Bejta

to no avail.

© Stack Overflow or respective owner

Related posts about git

Related posts about diff