From 83e2a9b1bab26e6ab1d411c63e6e5aa8f9a756da Mon Sep 17 00:00:00 2001 From: baalajimaestro Date: Sun, 25 Sep 2022 22:00:09 +0530 Subject: [PATCH] Clone the latest tag, instead of cloning master branch Signed-off-by: baalajimaestro --- push.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/push.sh b/push.sh index 2394604..de60e04 100644 --- a/push.sh +++ b/push.sh @@ -1,8 +1,8 @@ #!/bin/sh BASE_DIR=$(pwd) - -git clone https://${CONTENT_REPO_USERNAME}:${CONTENT_REPO_TOKEN}@git.baalajimaestro.me/baalajimaestro/${CONTENT_REPO_GIT} content +REPO="https://${CONTENT_REPO_USERNAME}:${CONTENT_REPO_TOKEN}@git.baalajimaestro.me/baalajimaestro/${CONTENT_REPO_GIT}" +git clone "$REPO" -b $(git ls-remote --tags --refs "$REPO" | tail -n1 | cut -d/ -f3) content rm -rf content/.obsidian rm -rf content/.gitlab-ci.yml