From dbaabe17d601b03c7341061b8d9f687f3c4ebaa2 Mon Sep 17 00:00:00 2001 From: Dmitriy Safronov Date: Tue, 17 Jan 2023 14:23:40 +0400 Subject: [PATCH] --force --- gitlab-ci.yml | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/gitlab-ci.yml b/gitlab-ci.yml index bcd96ca..d7584ef 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 -- GitLab