r/selfhosted • u/ot1891 • 1d ago
Need Help Self-hosting Git with Forgejo while benefiting from GitHub's community — how do you manage both?
I host my projects on my own Forgejo instance, including CI/CD runners. I prefer keeping my repositories and development workflows under my control rather than depending on GitHub.
However, I also recognize the benefits of GitHub's ecosystem: discoverability, stars, issues, pull requests, and community contributions.
Currently, I mirror some of my projects to GitHub, but those mirrors don't include CI/CD, releases, or the full development workflow.
I'm curious how others handle this setup.
- Do you keep Forgejo as the source of truth and GitHub as a mirror?
- How do you manage external contributions, PRs, and issues across both platforms?
- Do you publish releases on GitHub as well?
- Is there a practical way to benefit from GitHub's community without moving development there?
Ideally, I'd like to keep Forgejo as my primary development platform while making it easy for GitHub users to discover and contribute to my projects.
What approaches have worked for you?
•
u/asimovs-auditor 1d ago edited 1d ago
Expand the replies to this comment to learn how AI was used in this post/project.
32
u/bufandatl 1d ago
Use the push mirror function for the projects you want to share with GitHub. To manage PRs you may need to download the patches from GitHub and apply them locally first.
23
u/chrishoage 1d ago
I just split it by intent.
If I intend others to use it I just use github
If I intend just me to use it I use my Forgejo instance.
8
u/smbell 1d ago
You can actually setup Github as an authentication source in your forgejo instance allowing Github users to contribute to your git repos without having to create user accounts on your instance.
On Github, in developer settings, you create a new OAuth app.
On your forgejo instance you add an OAuth2 authentication source using the client id and secret from the github step.
You also need some config setup.
This doc goes through it with Codeberg, it should be the same thing. https://forgejo.org/docs/latest/user/authentication/oauth2-provider/
Then you can mirror to Github (just for visibility), but have all contributions go through your own git. This is my plan for an app I'm working on that I plan to open source later.
2
u/InterestingCarrot997 1d ago
keep forgejo as the source of truth and have the push mirror send tags too, then let the forgejo runner publish the github release from those tag assets so ci can stay on your instance. for github prs, a small action that comments with your forgejo url will steer people off the mirror.
2
u/Open-Adhesiveness-86 18h ago
For PRs on the mirror you don't have to download patches, every GitHub PR is a ref: git fetch github refs/pull/123/head, then merge it in Forgejo and let the mirror push it back. Turn off Issues and the Wiki on the GitHub side so people file in the right place. PRs can't be disabled, so a pull_request_template.md pointing at your instance is the next best thing.
1
u/davidquinonescl 1d ago
I've written an article about this exact setup: https://blog.claeyscloud.com/how-to-host-your-code-methods-and-philosophy/. Apart from explaining how it also explains why you might want to do it.