fix: configure git pull.rebase to prevent divergent branch errors

This commit is contained in:
Yury Kossakovsky
2025-12-22 09:22:42 -07:00
parent 8650c70992
commit d6cd2d44df
2 changed files with 9 additions and 0 deletions

View File

@@ -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..."

View File

@@ -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."