Reputation: 110620
I change 3 files in my git commit. I don't understand:
why git thinks I change in the following file? The diff shows no difference.
how can i remove this file change in my git commit?
diff --git a/src/StateListener.java b/src/StateListener.java
index 0125c44..6ba0874 100644
--- a/src/StateListener.java
+++ b/src/StateListener.java
@@ -7,8 +7,8 @@ import android.telephony.PhoneStateListener;
import android.telephony.TelephonyManager;
import android.util.Log;
-public class StateListener extends PhoneStateListener {
+public class StateListener extends PhoneStateListener {
private Context mContext;
Upvotes: 1
Views: 179
Reputation: 10740
Use "git checkout src/StateListener.java" to discard changes in working directory.
Upvotes: 2
Reputation: 17157
It is probably a whitespace change, undo the change and git commit --amend
it.
Alternatively do the following:
$ git reset --soft HEAD^
$ git checkout -f src/StateListener.java
$ git commit -c ORIG_HEAD
Upvotes: 3