Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Let's say I have the following file committed in my git repository:

$ cat a.txt

a
b
c

I make some changes and add them to the index:

$ git add a.txt && git diff --cached a.txt

-a
-b
-c
+A
+B
+C

Now I change my mind and want to unstage the capitalization of b. There was a period some time ago, I don't know which versions, when git reset -p would show me the reverse patch:

$ git reset -p a.txt

-A
-B
-C
+a
+b
+c
Apply this hunk to index [y,n,q,a,d,/,s,e,?]?

and I could hit e and manually edit out everything but the -B +b part. Great! However, as of git version 1.8.5.2, git is back to this behaviour:

$ git reset -p a.txt

-a
-b
-c
+A
+B
+C
Unstage this hunk [y,n,q,a,d,/,s,e,?]?

and I've never been able to wrap my head around how to operate manual editing in this mode. Is it possible to configure git to use the "Apply this hunk to index?" behaviour?

share|improve this question

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.