Skip to content

Instantly share code, notes, and snippets.

@tiborvass
Created January 28, 2015 01:58
Show Gist options
  • Save tiborvass/6f896b8550942eed251b to your computer and use it in GitHub Desktop.
Save tiborvass/6f896b8550942eed251b to your computer and use it in GitHub Desktop.
git mdiff
[alias]
mdiff = "!f() { git stash | head -1 | grep -q 'No local changes to save'; x=$?; git merge --no-commit $1 &>/dev/null; git add -u &>/dev/null; git diff --staged; git reset --hard &>/dev/null; test $x -ne 0 && git stash pop &>/dev/null; }; f"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment