diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 99ff94c61dcb2c0e1a16ba64ada0945d10d1612c..2bca72d475d35c75db12611cd890bf4ec4a45118 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -44,29 +44,25 @@ stages:
   - deploy
 
 clang-format:
-    image: alpine:latest
+    image: registry.git-ce.rwth-aachen.de/vr-vis/vr-group/unreal-development/plugins/rwth-vr-toolkit/alpine-analyze:latest
     tags:
         - docker-executor
         - linux
     rules:
         - if: $CI_PIPELINE_SOURCE == "merge_request_event"
-        - if: $CI_PIPELINE_SOURCE == "web"
     variables:
         GIT_STRATEGY: fetch
         GIT_CHECKOUT: "true"
         GIT_DEPTH: "2"
     stage: analyze
     allow_failure: false
-    before_script:
-        - apk update
-        - apk add clang-extra-tools git python3
     script:
-        - ls -la
         - clang-format --version
-        - linter_errors=$(git-clang-format --commit "HEAD~1" *.h *.cpp -q --diff | grep -v --color=always "no modified files to format" || true)
+        - git fetch origin $CI_MERGE_REQUEST_TARGET_BRANCH_NAME --depth 1
+        - echo $CI_MERGE_REQUEST_DIFF_BASE_SHA 
+        - linter_errors=$(unbuffer git-clang-format --commit "$CI_MERGE_REQUEST_DIFF_BASE_SHA" *.h *.cpp -q --diff | grep -v --color=always "no modified files to format" || true)
         - echo "$linter_errors"
         - if [ ! -z "$linter_errors" ]; then echo "Detected formatting issues; please fix"; exit 1; else echo "Formatting is correct"; exit 0; fi
-    
 
 Generate_Project:
     only: ['web', 'schedules']