One-liner to only add non-whitespace diffs to git

Inspired by this link:

$ git diff -w | grep "diff --git" | awk '{print $4}' | sed 's/^b\///' | \
xargs -i git add '{}'

Leave a comment

Your email address will not be published. Required fields are marked *