diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index d3aa7f70a4e39d6db7c436a47cdc78986c0d3e9e..f63edb91cf9fdf39348ea4122046985264ab5e4a 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -22,6 +22,7 @@ lint:
         - curl --fail https://annoyatron-prod.q3k.org/ping/mr?mr=${CI_MERGE_REQUEST_IID}
         - git remote rm card10 || true # old gitlab runners might have this remote.
         - git fetch https://git.card10.badge.events.ccc.de/card10/firmware.git master:card10/master
+        - git merge-base --fork-point card10/master || ( echo "Your change needs to be rebased against current master."; exit 1; )
         - git diff --name-only $(git merge-base --fork-point card10/master)...HEAD | xargs tools/code-style.sh
         - git diff --exit-code
     only: