From fe5fb92e4825ae77501ec98c0917178223f3641d Mon Sep 17 00:00:00 2001 From: Muhammad Ibrahim Date: Wed, 17 Sep 2025 23:41:54 +0100 Subject: [PATCH] fix: Add git safe.directory configuration for update commands - Add 'git config --global --add safe.directory' before git pull in update_instance - Add same fix to small management script update command - Resolves 'dubious ownership' error when updating repositories that were cloned as root but accessed by different users This fixes the git ownership security warning that prevents git pull from working during updates. --- manage-patchmon.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/manage-patchmon.sh b/manage-patchmon.sh index f505dcd..d526af8 100755 --- a/manage-patchmon.sh +++ b/manage-patchmon.sh @@ -1144,6 +1144,7 @@ case \$1 in ;; "update") cd $APP_DIR + git config --global --add safe.directory $APP_DIR 2>/dev/null || true git pull npm install cd backend && npm install @@ -1364,6 +1365,10 @@ update_instance() { # Update code print_info "Pulling latest code..." + + # Fix git ownership issue if it exists + git config --global --add safe.directory "$app_dir" 2>/dev/null || true + git pull # Update dependencies