diff --git a/test-and-deploy.yml b/test-and-deploy.yml
index 053ba55639e5499c871ccc957073bf446ad72bfd..789c05bfd7224a7688bcf839343406cb9d63325f 100644
--- a/test-and-deploy.yml
+++ b/test-and-deploy.yml
@@ -699,8 +699,6 @@ Debug:
     - if [[ $EC -ne 0 ]]; then DOUPDATE=1; fi
     - rm /tmp/test.log >/dev/null 2>&1 || true
     - if [[ $DOUPDATE -eq 0 ]]; then exit 0; fi
-    - git remote rm origin
-    - git remote add origin git@${CI_SERVER_HOST}:$CI_PROJECT_PATH.git
     - composer update --no-interaction --no-progress --no-dev
   only:
     variables:
@@ -740,6 +738,8 @@ Debug:
     - COMMITFLAGS="[SKIP_CONFIG_IMPORT]"
     - if [[ "${SKIPRELEASE}" != "yes" ]]; then COMMITFLAGS="${COMMITFLAGS} [CREATE_RELEASE]"; fi
     - if [[ "${USELIVEDB}" == "yes" ]]; then COMMITFLAGS="${COMMITFLAGS} [PULL_DB]"; fi
+    - git remote rm origin
+    - git remote add origin git@${CI_SERVER_HOST}:$CI_PROJECT_PATH.git
     - git add composer.lock
     - git -c user.email=gitlab-runner@lakedrops.com -c user.name=GitLabCI commit -m "Updates recognized automatically ${COMMITFLAGS}"
     - git push origin HEAD:$CI_COMMIT_REF_NAME