From 1ac952c09464f46711eeeb64fc8c7e2d72cfdbdc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20unbrot=20P=C3=A4tzold?= Date: Mon, 4 May 2026 18:56:33 +0200 Subject: [PATCH] sync_client_software: fetch depth=1 and clean untracked files on upgrade Replace the broken `git rebase HEAD^` with a proper shallow fetch: - `git fetch --depth=1` limits local history to one commit, regardless of server history - `git reset --hard FETCH_HEAD` syncs the working tree to the fetched tip - `git clean -fd` removes untracked non-ignored files left by old versions - `git gc --prune=now` immediately purges unreachable history objects Co-Authored-By: Claude Sonnet 4.6 --- system_setup/sync_client_software.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/system_setup/sync_client_software.sh b/system_setup/sync_client_software.sh index bc19f3f..ca4f685 100755 --- a/system_setup/sync_client_software.sh +++ b/system_setup/sync_client_software.sh @@ -51,8 +51,8 @@ if [[ ! -z "${REPO_URL}" ]]; then else # Doing upgrade, discarding all local changes frist (is more save than forced pull) echo "Checks have passed, we are now upgrading via git." - #Fetch latest Updates and remove all history - git fetch origin && git reset --hard origin/${REPO_BRANCH} && git rebase HEAD^ + #Fetch latest commit only (depth=1), reset working tree, purge old history and untracked files + git fetch --depth=1 origin ${REPO_BRANCH} && git reset --hard FETCH_HEAD && git clean -fd && git gc --prune=now --quiet if [[ $? -ne 0 ]]; then echo "Error: Failure while updating, will continue as is." fi