git-sync-mirror icon indicating copy to clipboard operation
git-sync-mirror copied to clipboard

Sync fails (when rebasing and force pushing branch)

Open stefan1242 opened this issue 3 years ago • 4 comments

Hi guys!

Its not really an issue, its the correct behaviour of git, but it prevents a sync. When you push a new branch and later you rebase it and make a force push to your "SOURCE_REPO", than the sync must be also make a force push, otherwise the push will be rejected.

So it would be great if there are an option to force push instead of plain push in the sync() method. So user can decide if he needs force push or not.

stefan1242 avatar Mar 09 '22 08:03 stefan1242

Hey :wave: . This change makes sense. I see this implemented like this:

    git push \
      --all \
      $([ "${DO_FORCE_PUSH}" = true ] && echo "--force") \
      "${dst_repo}" \
    || [ "${TWO_WAY}" = true ]

Or similar. Can you file a pull request for that?

Enteee avatar Mar 11 '22 07:03 Enteee

Hey, did it :)

stefan1242 avatar Mar 11 '22 08:03 stefan1242

Hey again, maybe it would be good to update also the official docker hub image.

Thanks :)

stefan1242 avatar Jul 18 '22 08:07 stefan1242

done. thx for reminding me.

Enteee avatar Jul 25 '22 19:07 Enteee