Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save mokolabs/54473f7b46cf67e73c953c6986ed407f to your computer and use it in GitHub Desktop.

Select an option

Save mokolabs/54473f7b46cf67e73c953c6986ed407f to your computer and use it in GitHub Desktop.

Revisions

  1. mokolabs revised this gist Mar 1, 2024. 2 changed files with 1 addition and 4 deletions.
    4 changes: 0 additions & 4 deletions git-add-ignore-space-at-eol.sh
    Original file line number Diff line number Diff line change
    @@ -1,4 +0,0 @@
    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
    1 change: 1 addition & 0 deletions git-add-ignore-space.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1 @@
    git diff -w --no-color | git apply --cached --ignore-whitespace
  2. Neil Goldman created this gist Aug 2, 2017.
    4 changes: 4 additions & 0 deletions git-add-ignore-space-at-eol.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,4 @@
    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