diff --git a/CI/prepare_superbuild.cmake b/CI/prepare_superbuild.cmake
index 99b13de1228ede9e890bb55c76271d277177f77a..b61877759155e263cce390f47665cb346b9fe88f 100644
--- a/CI/prepare_superbuild.cmake
+++ b/CI/prepare_superbuild.cmake
@@ -58,12 +58,20 @@ set (CTEST_INSTALL_DIRECTORY "${CI_ROOT_DIR}/xdk/")
 # This is needed because when using return() function ctest is trying
 # to run the CTEST_COMMAND. And we need it to not produce an error
 set (CTEST_COMMAND "echo \"Exit\"") # HACK FIX ME
-set (CMAKE_COMMAND "cmake")########################################################################
+set (CMAKE_COMMAND "cmake")
+
+########################################################################
 ########################################################################
 # Build process
 ########################################################################
 ########################################################################
 
+# Look for a GIT command-line client.
+find_program(CTEST_GIT_COMMAND NAMES git git.cmd)
+
+# FIXME: Replace ${GIT} variable with $[CTEST_GIT_COMMAND}"
+set( GIT "${CTEST_GIT_COMMAND}" )
+
 # Sources are already checked out : do nothing for update
 set(CTEST_GIT_UPDATE_CUSTOM echo No update)
 
@@ -126,12 +134,6 @@ message( "Checking out git for existence of archive")
 set ( REMOTE "https://gitlab.orfeo-toolbox.org/gbonnefille/superbuild-artifact/")
 set ( BRANCH_NAME "${IMAGE_NAME}/${SB_MD5}")
 
-# Look for a GIT command-line client.
-find_program(CTEST_GIT_COMMAND NAMES git git.cmd)
-
-# FIXME: Replace ${GIT} variable with $[CTEST_GIT_COMMAND}"
-set( GIT "git" )
-
 execute_process(
   COMMAND ${GIT} "ls-remote" "${REMOTE}" "${BRANCH_NAME}"
   OUTPUT_VARIABLE IS_SB_BUILD