2

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?

Community
  • 1
  • 1
Radek Liska
  • 242
  • 1
  • 8

1 Answers1

3

This is one way:

git diff -w --no-color > patch 
git stash 
patch -p1 < patch
git add -i
Kenney
  • 9,003
  • 15
  • 21