From d55180e04818f980468d0f1c2530985c10c83960 Mon Sep 17 00:00:00 2001 From: Kerboul Date: Sun, 27 Apr 2025 00:09:27 +0200 Subject: [PATCH] =?UTF-8?q?Am=C3=A9liorer=20la=20mise=20=C3=A0=20jour=20du?= =?UTF-8?q?=20d=C3=A9p=C3=B4t=20en=20rempla=C3=A7ant=20'git=20pull'=20par?= =?UTF-8?q?=20'git=20fetch'=20et=20'git=20checkout'=20pour=20une=20gestion?= =?UTF-8?q?=20plus=20pr=C3=A9cise=20des=20branches.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- deploy.sh | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/deploy.sh b/deploy.sh index 68ed269..89ba255 100755 --- a/deploy.sh +++ b/deploy.sh @@ -29,13 +29,14 @@ trap cleanup EXIT main() { log "Starting deployment..." - # Git pull force - log "Pulling latest changes from the repository..." - git pull origin main --force + log "Updating repository to match remote main branch..." + git fetch origin + git checkout -f origin/main if [ $? -ne 0 ]; then - log "Failed to pull latest changes." + log "Failed to update to the latest main branch." exit 1 fi + log "Repository successfully updated to latest main branch." # Lancer le docker log "Building and starting Docker containers..."