-
-
Notifications
You must be signed in to change notification settings - Fork 5.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bidirectional Mirroring e.g. GitLab Mirroring #2280
Comments
How would merge conflicts be resolved? |
Like GitLab, it probably shouldn't perform merges. If a fast-forward is not possible, it simply shows the sync error messages. Additionally, if we can set a low sync time and have the repository both push and pull to the upstream mirror, the amount of conflicts would be much lower. |
The only way to implement this correctly would be to pull on each push |
@bkcsoft, I personally rather that the basic GitLab behaviour be included within the next release than having to wait for the hammering and debate for advanced Gitea-flavour behaviours to be included within the 2020 release. I would personally be more than happy to work on Gitea again but there are a few reasons barring me from doing so. |
I've thought about it for a bit and I think I have a strategy that may work. Essentially, Gitea pulls upstream repository every set interval or pre-push. After pulling, check if current push can be easily fast-forwarded, else reject and force user to pull first? What do you think @bkcsoft? |
@lflare I think it would really slow down pushing to gitea if it would require pulling remote server |
I think I miss the point of this feature. Can someone enlighten me and give use cases where this is useful / necessary? |
@lafriks Maybe but also maybe not. Git when not transferring file content data, is relatively lightweight in that it compares checksums. @daviian My case scenario is that I run Gitea with Github and I would really love to be able to push to my private Gitea and have it mirror the push to Github so I don't have to push twice and potentially forget to push. |
@lflare But why do you prefer pushing to gitea instead of directly pushing to github? What advantages to you see in doing so? |
If nobody is pushing to GitHub directly might be easier to set push git hook to push it further to github |
@daviian I have people working on both the private Gitea instance and the Github instance and I personally prefer working on the private Gitea instance but also want the publicity of the repository being published on Github. @lafriks That's when this feature request comes in, it's easily implementable with a couple of commands but it's incredibly inefficient if manual editing of the githooks are required every time I want to mirror a new repository. |
@lflare How do you manage releases etc.? Do you create every release twice? |
@daviian Currently, I don't create releases, I just tag versions. This is off-topic though. |
What I do is have mirrors on github, with people only contributing via PR, then the PR is merged via commandline instead of via pushing the github button. A mirroring script, triggered by web hook, force-pushes into the github repo. |
@strk I would also want something like this. I want to use Travis ci with some of my repos for testing on macOS, but it does not work with gitea, so I would want mirroring to GitHub from gitea |
Essentially one of the sites has to be the authorative truth.
For "Gitea is Authorative" the sequence would be
|
I use Travis with unidirectional mirroring:
Gitea triggers mirrorer script which pushes to GitHub
(and GitLab) which triggers Travis (and gitlab-ci).
|
Never mind, I've worked out a solution that I'm happy with in a patch on my fork. Thanks. |
This can still be left open as feature request |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs during the next 2 weeks. Thank you for your contributions. |
Not stale. |
@lunny What does that label mean? |
@lflare just for stale bot not to close this for inactivity |
You can't have bidirectional mirrors; you need something to mirror. There is one real object and one or more mirror images. That's just the way it is. There can only be one master. |
@lifranc, I respectfully disagree. There's many applications for bidirectional mirroring for repositories. The wonders of Git allows for atomic commit histories and as long as there is a common base for repositories to be merged and mirrored, it can be done. What is required, is a way for a user to configure merge strategies when a conflict is detected between two bidirectional mirrors, or perhaps a manual selector to choose how a conflict should be resolved. Apart from that, it should just behave like your traditional cloud file storage syncing mechanism. |
That's not mirroring. Fine then you want to automate two-way merging. You could perhaps reason about it better if you considered this way. To me a mirror doesnt take actions; it only replicates a master, hence the confusion. I dont see any disagreement, just a different use of words. PS. Those who are disgruntled by the fact that mirrors can only reflect already existing light are in for a tough life. PPS. Matrix protocol does something like this to synchronize rooms across the federation. It's not trivial. Much easier to create a mirror of each repo on the other servers, and merge using those, that way there is no conflict blocking the flow of data, and automatic merging can still be used there. |
any updates? |
For the record https://gitea.com/earl-warren/gitea/pulls/2 is the first step to support the Friendly Forge Format (F3) which can eventually be used for bi-directional mirroring including issues, releases etc. |
For the record #6071 was closed because it was market about a duplicate (or is at least part of the issue). Simple git to git mirroring would be still possible either by overriding everything or synchronizing only specific ref/excluding to sync sync some. |
any updates? We can accpet conflict occurs and resolve conflict manually, but we want this feature. |
|
[I18n] Translations update from Weblate (go-gitea#2254) Translations update from [Weblate](https://translate.codeberg.org) for [Forgejo/forgejo](https://translate.codeberg.org/projects/forgejo/forgejo/). Current translation status: ![Weblate translation status](https://translate.codeberg.org/widget/forgejo/forgejo/horizontal-auto.svg) Co-authored-by: earl-work01 <contact+work01@earl-warren.org> Co-authored-by: walpo <walpo@users.noreply.translate.codeberg.org> Co-authored-by: Gusted <postmaster+codeberg@gusted.xyz> Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2254 Co-authored-by: Codeberg Translate <translate@noreply.codeberg.org> Co-committed-by: Codeberg Translate <translate@noreply.codeberg.org> Translations update from Weblate (go-gitea#2258) Translations update from [Weblate](https://translate.codeberg.org) for [Forgejo/forgejo](https://translate.codeberg.org/projects/forgejo/forgejo/). Current translation status: ![Weblate translation status](https://translate.codeberg.org/widget/forgejo/forgejo/horizontal-auto.svg) Co-authored-by: Squeljur <squeljur+git@gmail.com> Co-authored-by: oatbiscuits <oatbiscuits@proton.me> Co-authored-by: Gusted <postmaster@gusted.xyz> Co-authored-by: jadedctrl <jadedctrl@posteo.at> Co-authored-by: earl-warren <contact@earl-warren.org> Co-authored-by: 0que <0que@users.noreply.translate.codeberg.org> Co-authored-by: noureddin <noureddin@protonmail.com> Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2258 Co-authored-by: Codeberg Translate <translate@noreply.codeberg.org> Co-committed-by: Codeberg Translate <translate@noreply.codeberg.org> [I18N] Translations update from Weblate (go-gitea#2274) Translations update from [Weblate](https://translate.codeberg.org) for [Forgejo/forgejo](https://translate.codeberg.org/projects/forgejo/forgejo/). Current translation status: ![Weblate translation status](https://translate.codeberg.org/widget/forgejo/forgejo/horizontal-auto.svg) Co-authored-by: Gusted <postmaster@gusted.xyz> Co-authored-by: 0que <0que@users.noreply.translate.codeberg.org> Co-authored-by: oatbiscuits <oatbiscuits@proton.me> Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2274 Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org> Co-authored-by: Codeberg Translate <translate@noreply.codeberg.org> Co-committed-by: Codeberg Translate <translate@noreply.codeberg.org> [I18N] Translations update from Weblate (go-gitea#2280) Translations update from [Weblate](https://translate.codeberg.org) for [Forgejo/forgejo](https://translate.codeberg.org/projects/forgejo/forgejo/). Current translation status: ![Weblate translation status](https://translate.codeberg.org/widget/forgejo/forgejo/horizontal-auto.svg) Co-authored-by: earl-warren <contact@earl-warren.org> Co-authored-by: micash <micash_545@protonmail.com> Co-authored-by: 0que <0que@users.noreply.translate.codeberg.org> Co-authored-by: oatbiscuits <oatbiscuits@proton.me> Co-authored-by: jadedctrl <jadedctrl@posteo.at> Co-authored-by: Werenter <abelokopytov149@gmail.com> Co-authored-by: bizdelnick <mikhirev@gmail.com> Co-authored-by: Xinayder <me+codeberg@aoalmeida.com> Co-authored-by: noureddin <noureddin@protonmail.com> Co-authored-by: nykula <nykula@ukr.net> Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2280 Co-authored-by: Codeberg Translate <translate@noreply.codeberg.org> Co-committed-by: Codeberg Translate <translate@noreply.codeberg.org> (cherry picked from commit 9efeca55b1032d16284ad5e687440405cab775ef)
[x]
): N.ADescription
Very simply, I understand that the current Gitea implementation has one-way remote mirroring, with the inability to modify the mirrored repository. However, I wish to propose a mirroring solution akin to that used in GitLab. Is this a feasible proposal? This feature is the only reason I have not switched fully to Gitea after all.
Screenshots
N.A
The text was updated successfully, but these errors were encountered: