I have this file committed:
foo.txt
line 1
line 2
line 3
Now I modify it to become:
line 1
line 1.5
line 2
line 2.5
line 3
and I run git add . && git diff --cached foo.txt and this is what I get:
diff --git a/foo.txt b/foo.txt
index c4dfc64..4942553 100644
--- a/foo.txt
+++ b/foo.txt
@@ -1,3 +1,5 @@
line 1
+line 1.5^M
line 2
+line 2.5^M
line 3
Let's say I now want to remove line 1.5 from the index and keep line 2.5, how would I do this with LibGit2Sharp?
This can be also asked the other way around: how do I add parts of the file to index? I'm looking for some kind of programmatic version of git add -p.