Commit dbaabe17 authored by Dmitriy Safronov's avatar Dmitriy Safronov
Browse files

--force

parent 0ba6581b
Loading
Loading
Loading
Loading
+5 −7
Original line number Diff line number Diff line
@@ -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