Skip to content

[feature request] Add Push Mirrors #5

Open

Description

@cybardev

Currently the repositories are mirrored as pull mirrors. I want them to be added as push mirrors (too).

The relevant endpoint in the Forgejo API is /repos/{owner}/{repo}/push_mirrors.

Since mirroring using SSH requires manually adding the SSH public key of each repository from Forgejo to GitHub, I think it's okay to just use the HTTP(S) URLs instead.

Activity

  1. cybardev commented on Jul 23, 2025

    @cybardev
    ContributorAuthor

    Not sure if this is related, but I notice that repository description and topics are not migrated either.


    Here's a repo I migrated manually (through Forgejo web UI):

    • Forgejo:
      Image
    • GitHub:
      Image

    Here's one done through the script:

    • Forgejo:
      Image

    • GitHub:
      Image


    The icon (notice the top-left corner of Forgejo screenshots) is also different, and the mirrors created by the tool say that it's a mirror (under the repo name). Maybe what I want is out of scope for this tool? Let me know if that is the case and I will close the issue. Thanks.

  2. RGBCube commented on Jul 23, 2025

    @RGBCube
    Owner

    Can you show me the exact UI that created that manual mirror?

    Also I'm not sure if Forgejo actually lets you create bidirectional mirrors, if it does, then it should be in scope.

    Regarding descriptions: That's actually interesting, I should add that + tag + etc mirroring too with a flag.

    I'll get to these when I have the time.

  3. cybardev commented on Jul 23, 2025

    @cybardev
    ContributorAuthor

    Apologies, I misremembered. For the nix-dotfiles repo I migrated the repo without setting up a pull mirror. Then just added the push mirror from the UI.

    I just created a test repo on GitHub to try something, and it seems that bidirectional mirrors are indeed not possible. I can add a push mirror after adding a pull mirror (the reverse cannot be done), but even then the Forgejo instance will not have PRs.

    I guess if I want to migrate repos as push mirrors, my best bet is to create a separate tool that does that?

    I basically want to move activities away from GitHub (as much as feasible) and mainly keep it as a public mirror of my Forgejo instance, as backup and for sharing links.

  4. regulad commented on Mar 4, 2026

    @regulad

    I'm going to open an issue on Forgejo's GitHub tracker requesting bidirectional sync support. I'll see if it's within my ability to write it myself: I'm not a huge gopher but I can write snippets.

  5. regulad commented on Mar 4, 2026

    @regulad

    https://codeberg.org/forgejo/forgejo/issues/11503

    Please show your support here if you also concur that this functionality should be supported by Forgejo.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions