Skip to content

Instantly share code, notes, and snippets.

@neilgoldman
Created August 2, 2017 19:03
Show Gist options
  • Save neilgoldman/cd7171ec0921f0a59c82596f49a78223 to your computer and use it in GitHub Desktop.
Save neilgoldman/cd7171ec0921f0a59c82596f49a78223 to your computer and use it in GitHub Desktop.
Git Add But Ignore EOL Whitespace
git diff --ignore-space-at-eol --no-color | git apply --cached --ignore-whitespace
# substitute `--ignore-space-at-eol` with `-w` to ignore all modified whitespace (don't do this when committing Python of course)
# optionally, run `git checkout .` afterwards to remove EOL-only changes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment