diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index ca08d60df4cd2193622281b8cf57ff16e56019e0..3b96a19a4403dca4b68ec7311b2caa9614f05671 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -28,7 +28,7 @@ pytest:
     #  Our self-hosted runners have persistent home directories, so here we store
     #  the known_hosts file in the temporary project dir and tell git to use a ssh
     #  command that uses this hosts file during operations
-    - export GIT_SSH_COMMAND="ssh UserKnownHostsFile=$CI_PROJECT_DIR/.ssh/known_hosts"
+    - export GIT_SSH_COMMAND="ssh -o UserKnownHostsFile=$CI_PROJECT_DIR/.ssh/known_hosts"
     - mkdir -p $CI_PROJECT_DIR/.ssh
     - chmod 700 $CI_PROJECT_DIR/.ssh
     - ssh-keyscan -p 10022 git.xfel.eu > $CI_PROJECT_DIR/.ssh/known_hosts