diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 65be5602a8e17b49dca77603899216467aabeae8..4244fe03e0f885f28d37f7ee3d8cc207bbf97ec5 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -69,10 +69,10 @@ stages:
   -   git checkout devel
   -   git pull
   -   git checkout $WOLF_CORE_BRANCH
+  -   git pull
   - else
-  -   git clone ssh://git@gitlab.iri.upc.edu:2202/mobile_robotics/wolf_projects/wolf_lib/wolf.git
+  -   git clone -b $WOLF_CORE_BRANCH ssh://git@gitlab.iri.upc.edu:2202/mobile_robotics/wolf_projects/wolf_lib/wolf.git
   -   cd wolf
-  -   git checkout $WOLF_CORE_BRANCH
   - fi
   - mkdir -pv build
   - cd build
@@ -85,9 +85,12 @@ stages:
   - if [ -d imu ]; then
   -   echo "directory imu exists"
   -   cd imu
+  -   git checkout devel
+  -   git pull
+  -   git checkout $WOLF_IMU_BRANCH
   -   git pull
   - else
-  -   git clone ssh://git@gitlab.iri.upc.edu:2202/mobile_robotics/wolf_projects/wolf_lib/plugins/imu.git
+  -   git clone -b $WOLF_IMU_BRANCH ssh://git@gitlab.iri.upc.edu:2202/mobile_robotics/wolf_projects/wolf_lib/plugins/imu.git
   -   cd imu
   - fi
   - mkdir -pv build