Reputation: 251
There are about 5 relevant questions on this on SO, but I did not yet find the answer. The closest I have got is with the idea from this answer.
git diff -w --no-color | git apply --cached --ignore-whitespace
This doesn't work. It will add all the changes, but I want to do it per partes. Is there an improved way that also adds the behaviour -p
flag of git add
?
Upvotes: 2
Views: 51
Reputation: 9093
This is one way:
git diff -w --no-color > patch
git stash
patch -p1 < patch
git add -i
Upvotes: 3