From d6cd2d44df7065ce6b5e9082de6949112efdd84c Mon Sep 17 00:00:00 2001 From: Yury Kossakovsky Date: Mon, 22 Dec 2025 09:22:42 -0700 Subject: [PATCH] fix: configure git pull.rebase to prevent divergent branch errors --- scripts/01_system_preparation.sh | 4 ++++ scripts/update.sh | 5 +++++ 2 files changed, 9 insertions(+) diff --git a/scripts/01_system_preparation.sh b/scripts/01_system_preparation.sh index c30e838..4a55993 100755 --- a/scripts/01_system_preparation.sh +++ b/scripts/01_system_preparation.sh @@ -38,6 +38,10 @@ apt install -y \ build-essential ca-certificates gnupg lsb-release openssl \ apt-transport-https python3-dotenv python3-yaml +# Configure git to use rebase on pull (prevents merge commits during updates) +log_info "Configuring git pull strategy..." +git config --global pull.rebase true + # Configuring Firewall (UFW) log_subheader "Firewall (UFW)" log_info "Configuring firewall..." diff --git a/scripts/update.sh b/scripts/update.sh index 5b28acc..2664a26 100755 --- a/scripts/update.sh +++ b/scripts/update.sh @@ -64,6 +64,11 @@ else # Change to project root for git pull cd "$PROJECT_ROOT" || { log_error "Failed to change directory to $PROJECT_ROOT"; exit 1; } + # Ensure git pull.rebase is configured (fallback for older installations) + if [ -z "$(git config --global pull.rebase)" ]; then + git config --global pull.rebase true + fi + # Backup user-customizable directories before git reset (uses PRESERVE_DIRS from utils.sh) if ! BACKUP_PATH=$(backup_preserved_dirs); then log_error "Backup failed. Aborting update to prevent data loss."