1
Details
2
Source
3
Tags & license
4
Review

Publish a new script

Free, public, MIT by default. Everything below is editable after publishing.

Slug * kebab-case · 3–48 chars
→ ins install git-stash-diff
Title * 38 / 80
One-line description * 112 / 160
Language *
Surface
Source * git-stash-diff.sh · 38 lines
git-stash-diff.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#!/usr/bin/env bash # git-stash-diff: show a stash diff without applying it set -euo pipefail stash_ref="${1:-stash@{0}}" if ! git rev-parse --verify "$stash_ref" >/dev/null 2>&1; then echo "no stash matching $stash_ref" >&2 exit 1 fi git --no-pager diff --color=always "$stash_ref"^! \ | less -R --no-init --quit-if-one-screen
tip: drag-and-drop a file or paste from clipboard