Skip to content

Instantly share code, notes, and snippets.

@mgaitan
Created October 9, 2013 16:22
Show Gist options
  • Select an option

  • Save mgaitan/6903944 to your computer and use it in GitHub Desktop.

Select an option

Save mgaitan/6903944 to your computer and use it in GitHub Desktop.
apply the current changes ignoring whitespaces [1] (keeping a popped stash as backup). [2] [1] http://stackoverflow.com/a/6311302 [2] http://stackoverflow.com/questions/89332/recover-dropped-stash-in-git
#/usr/bin/env sh
git stash && git stash pop && git diff -w > foo.patch && git checkout . && git apply foo.patch && rm foo.patch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment