diff --git a/gitlab-ci.yml b/gitlab-ci.yml index bcd96cae3a1869f5979bf2db7d6b2d5d41a7f5b9..d7584efa6a9739c5a0d35f8efe09d842359c508f 100644 --- a/gitlab-ci.yml +++ b/gitlab-ci.yml @@ -52,11 +52,9 @@ sync: script: - echo "[${GIT_PULL_REPO}#${GIT_PULL_BRANCH:-master}] -> [${GIT_PUSH_REPO}#${GIT_PUSH_BRANCH:-master}]" - rm -rf /tmp/repo - - git clone "${GIT_PUSH_REPO}" /tmp/repo + - git clone "${GIT_PULL_REPO}" -b "${GIT_PULL_BRANCH:-master}" /tmp/repo - cd /tmp/repo - - git checkout "${GIT_PUSH_BRANCH:-master}" - - git remote add upstream "${GIT_PULL_REPO}" - - test -n "${GIT_TAGS}" && git fetch upstream --tags || true - - git pull --ff-only upstream "${GIT_PULL_BRANCH:-master}" - - git push --force origin "${GIT_PUSH_BRANCH:-master}" - - test -n "${GIT_TAGS}" && git push --force origin --tags || true + - test -n "${GIT_TAGS}" && git fetch --tags || true + - git remote add downstream "${GIT_PUSH_REPO}" + - git push --force downstream "${GIT_PUSH_BRANCH:-master}" + - test -n "${GIT_TAGS}" && git push --force downstream --tags || true