diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 918fc9273470fb66f0021171c90d310a76161b70..cd96ed5972fd8c427cbff103f81cee3d3d8cd371 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -23,8 +23,8 @@ build-job:       # This job runs in the build stage, which runs first.
   stage: build
   script:
     - echo "Compiling the code..."
-    - git submodule foreach --recursive git submodule init
-    - git fetch --recurse-submodules
+    - git submodule update --init --recursive
+    - git pull --recurse-submodules
     - cd nanosoc_board/
     - source export_sdk_dirs.sh
     - cd C_Cxx