From 30d8f00aeb615792c80a146dacd84ca4346e7b7b Mon Sep 17 00:00:00 2001 From: SpudGunMan Date: Sun, 28 Sep 2025 17:25:31 -0700 Subject: [PATCH] Update update.sh --- update.sh | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/update.sh b/update.sh index 22d623e..405f316 100644 --- a/update.sh +++ b/update.sh @@ -24,20 +24,16 @@ if systemctl is-active --quiet mesh_bot_w3.service; then service_stopped=true fi -# handle git with venv -if [ -n "$VIRTUAL_ENV" ]; then - echo "You are inside a Python virtual environment. Please run this script outside the venv for git operations." -else - echo "Pulling latest changes from GitHub..." - if ! git pull origin main --rebase; then - read -p "Git pull resulted in conflicts. Do you want to reset hard to origin/main? This will discard local changes. (y/n): " choice - if [[ "$choice" == "y" || "$choice" == "Y" ]]; then - git fetch --all - git reset --hard origin/main - echo "Local repository updated." - else - echo "Update aborted due to git conflicts." - fi +# git pull with rebase to avoid unnecessary merge commits +echo "Pulling latest changes from GitHub..." +if ! git pull origin main --rebase; then + read -p "Git pull resulted in conflicts. Do you want to reset hard to origin/main? This will discard local changes. (y/n): " choice + if [[ "$choice" == "y" || "$choice" == "Y" ]]; then + git fetch --all + git reset --hard origin/main + echo "Local repository updated." + else + echo "Update aborted due to git conflicts." fi fi