diff --git a/.gitlab-ci-init.yml b/.gitlab-ci-init.yml
index d9c7a3cd3c79466764e1c9a3b099e5ee4e9ce6fe..0ae66096db17c8118b5ee1c325a1a7c935d0ab52 100644
--- a/.gitlab-ci-init.yml
+++ b/.gitlab-ci-init.yml
@@ -38,6 +38,7 @@ prepare:
   script:
     - git config user.name "Your Name"
     - git config user.email "you@example.com"
+    - git remote rm github || true
     - git remote add github ${GITHUB_REPOSITORY}
     - git fetch github ${GITHUB_REF}
     - git merge --allow-unrelated-histories --no-commit --no-ff github/${GITHUB_REF}