From a1d1e7413de65559935848ff853131193eb0649a Mon Sep 17 00:00:00 2001 From: Aravinth Manivannan Date: Sat, 21 Oct 2023 14:50:42 +0530 Subject: [PATCH] feat: stash changes before checkout --- scripts/hugo.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scripts/hugo.sh b/scripts/hugo.sh index 73ca418..cf15608 100755 --- a/scripts/hugo.sh +++ b/scripts/hugo.sh @@ -101,10 +101,12 @@ deploy() { if [[ -z $(git ls-remote --heads origin ${1}) ]] then echo "[*] Creating deployment branch $1" + git stash git checkout --orphan $1 else echo "[*] Deployment branch $1 exists, pulling changes from remote" git fetch origin $1 + git stash git switch $1 fi