Fix git update conflicts in setup.sh --update

- Add git clean -fd to remove untracked files before pull
- Add git reset --hard HEAD to ensure clean state
- Prevents merge conflicts from untracked files during updates
- Ensures smooth updates from any version to any version
This commit is contained in:
Muhammad Ibrahim
2025-10-13 21:15:04 +01:00
parent cc8f77a946
commit 3863d641fa

View File

@@ -1769,6 +1769,14 @@ update_installation() {
print_info "Pulling latest code from branch: $DEPLOYMENT_BRANCH"
cd "$instance_dir"
# Clean up any untracked files that might conflict with incoming changes
print_info "Cleaning up untracked files to prevent merge conflicts..."
git clean -fd
# Reset any local changes to ensure clean state
print_info "Resetting local changes to ensure clean state..."
git reset --hard HEAD
# Fetch latest changes
git fetch origin