From 0f6eeb776eed393165e496673e645682834a08d8 Mon Sep 17 00:00:00 2001 From: ducoterra Date: Mon, 1 Nov 2021 10:01:12 -0400 Subject: [PATCH] Add make-stash-drop command Sometimes you can get stuck in a loop where git stash pop preserves the stash commit. Dropping that commit if it's a STASH commit after an update is totally fine. --- Makefile | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Makefile b/Makefile index 18e611b..02f380c 100644 --- a/Makefile +++ b/Makefile @@ -16,6 +16,10 @@ warning: @printf "Cancel with ctrl + c within 3 seconds." @sleep 3 +.PHONY: make-stash-drop +make-stash-drop: + @if [ ! -z "$$(git stash list | grep -r 'stash@{0}.*common')" ]; then git stash drop; fi + .PHONY: make-update make-update: warning @git stash save $(STASH)