You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
dotbare/scripts/fpop

10 lines
424 B
Bash

#!/bin/bash
selected_stash=$(/usr/bin/git --git-dir=$HOME/.cfg/ --work-tree=$HOME stash list | \
fzf --exit-0 --preview "echo {} | sed 's/://g' | awk '{print \$1}' | \
xargs -I __ /usr/bin/git --git-dir=$HOME/.cfg/ --work-tree=$HOME stash show -p __ --color" | \
sed 's/://g' | awk '{print $1}')
[[ -z "$selected_stash" ]] && exit 0
/usr/bin/git --git-dir=$HOME/.cfg/ --work-tree=$HOME stash apply "$selected_stash"