add delstash command
This commit is contained in:
parent
5cddd9fd55
commit
cf41612321
1 changed files with 12 additions and 0 deletions
|
@ -166,6 +166,18 @@ pop() {
|
||||||
git stash pop "$stash_ref"
|
git stash pop "$stash_ref"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
delstash() {
|
||||||
|
local selection
|
||||||
|
selection=$(git stash list | \
|
||||||
|
fzf --prompt="Select stash to pop: " \
|
||||||
|
--preview="git stash show -p \$(echo {} | awk -F: '{print \$1}') | bat --color always --paging=never --style=plain -l diff")
|
||||||
|
[ -z "$selection" ] && echo "No stash selected." && return 1
|
||||||
|
local stash_ref
|
||||||
|
stash_ref=$(echo "$selection" | awk -F: '{print $1}')
|
||||||
|
echo "About to delete $stash_ref."
|
||||||
|
git stash drop "$stash_ref";;
|
||||||
|
}
|
||||||
|
|
||||||
# nix
|
# nix
|
||||||
alias nixpkgs=nixpkg
|
alias nixpkgs=nixpkg
|
||||||
nixpkg () {
|
nixpkg () {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue