Contents
Figure 1: Best GitHub Alternatives and Git Hosting for Private ML Projects — your private repo holds training code, config files, and a 40 GB checkpoint someone committed by accident
Your team's private repo holds training code, config files, and a 40 GB checkpoint someone committed by accident. The host throttles your pushes, finance questions the per-seat bill, and legal asks where your data actually lives. Hosting private ML work differs from hosting a web app, because models and datasets stress Git in ways source code never does.
The best choice depends less on the host and more on how you handle large files and secrets. Plans, prices, and quotas change constantly, so verify every number on the vendor's own page before you migrate a team.
Why ML Projects Strain Git Hosting
Hugging Face's docs explain the core problem well. Their repositories hold files in the gigabyte range and above, and a pure Git repository cannot store them practically, because cloning pulls the full history including every file revision [1]. The standard workaround is pointer files: the Git repo stores small pointers, while the real data lives in remote storage.
That leads to the questions I ask about any host:
- Large file handling — Git LFS, a custom large-file system, or external storage?
- Storage and bandwidth limits — where do you hit quotas?
- Private repo features — branch protection, code review, access controls on your plan
- CI/CD — can you run tests and training jobs?
- Data control — where does the host store your data, and who can access it?
- Exit cost — how hard is migrating out later?
Ever pushed a checkpoint to a repo and watched the host reject it? That is the failure this article helps you avoid.
Two Layers: Code Hosting and Artifact Storage
Most teams do best by splitting the problem:
- Layer 1, code: a Git host for source, configs, small notebooks, issues, and reviews.
- Layer 2, artifacts: storage for datasets, checkpoints, and weights, referenced from Git by pointers or version tags.
You can pick them independently. A team might use GitLab or Forgejo for code, then Hugging Face Hub, an S3 bucket with DVC, or Git LFS for weights. Mixing hosts costs some convenience, but it fits ML's size mismatch — and it keeps your Git host from becoming a file server.
Code Hosting Options
GitLab: The All-in-One Replacement
GitLab is the closest thing to a drop-in GitHub replacement: repositories, CI/CD, issue tracking, a container registry, and security scanning in one platform. The free tier gives you 5 users per top-level group, 400 compute minutes per month, and 10 GiB of storage, and Premium is $29 per user per month billed annually [2].
What I like:
- CI/CD configured in
.gitlab-ci.yml, with no separate service to wire up - One platform for repos, pipelines, registry, and security tooling
- A self-managed path when you need your own infrastructure
What to check: self-hosting GitLab is resource-intensive. Running it yourself means patching, backups, and upgrades, so budget admin time.
I'd pick GitLab when I want an integrated DevOps platform, strong CI, and a clear path to self-hosting later.
Gitea: Lightweight Self-Hosting
Gitea suits teams that want a small server they control. It supports OAuth2 sign-in, LDAP and Active Directory integration, and a REST API that is close to GitHub's. Gitea Actions provides built-in CI/CD.
What to check: governance. Several veteran maintainers left to form Forgejo, and a private company now controls Gitea and operates gitea.com as a commercial service [4]. Choose Gitea if you want a commercial vendor behind your forge; choose Forgejo if you want the community to hold the keys.
I'd pick Gitea for a small team that wants a tiny, fast self-hosted forge with a vendor behind it.
Forgejo: Community-Governed Self-Hosting
Forgejo forked from Gitea in 2022 over exactly that governance question [4]. It ships Forgejo Actions, which aims for compatibility with GitHub Actions workflows, and takes a conservative release approach: fewer features, fewer surprises.
If you already have GitHub Actions workflows, that compatibility could save real migration effort — but test your real workflows, because "compatible" rarely means identical. I'd pick Forgejo for self-hosting where community governance and a copyleft licence matter.
Codeberg: Great for Open Source, Not for Private Work
Codeberg runs on Forgejo and comes from a registered non-profit in Berlin, funded by donations. That is wonderful for open source. But for this article's topic the docs are blunt: private content is capped at 100 MB, for contributors to free software projects [3]. Skip it for private ML projects.
Bitbucket: Best If You Already Use Jira
Bitbucket offers unlimited private repositories on its free plan, included Pipelines build minutes, and deep Jira integration [5]. Without the Atlassian ecosystem it offers little reason to choose it over GitHub or GitLab. Choose it when Jira already drives your workflow, and check Atlassian's current pricing before you plan seats.
Others Worth a Look
- Azure DevOps Repos suits Microsoft-centric organisations, with boards and pipelines in the same tenant.
- OneDev, Gogs, SourceHut, Radicle are fully self-hosted or lightweight alternatives. I'd treat them as niche picks and check their release cadence before betting a team on one.
Artifact and Model Storage Options
Hugging Face Hub: Built for Models and Datasets
The Hub uses Xet, a storage system built for AI/ML work that deduplicates at the chunk level, which means smaller uploads and faster downloads than Git LFS for the same weights [1]. Git LFS deduplicates whole files; Xet deduplicates at the byte level.
Private storage is where the plan matters [1]:
| Account | Private storage |
|---|---|
| Free user or org | 100 GB |
| PRO | 1 TB, then pay-as-you-go |
| Team organisation | 12 TB base + 1 TB per seat |
| Enterprise organisation | 200 TB base + 1 TB per seat |
Additional storage runs from $18 per TB per month at the base tier, dropping to $12 at 500 TB+ [1]. Older snapshots quote $25 — the docs are the source of truth, and they change.
Two more warnings from the docs. Keep repositories under 100,000 files and 10,000 entries per folder, because huge directories slow every operation [1]. And deleting LFS files is destructive and cannot be undone, so back up first [1].
The Hub is not a general software platform. Its repositories differ from those on software development platforms, and it is weak at code review and CI. Use it for weights and datasets, and pair it with a real Git host for code.
Git LFS on Your Host
Most Git hosts support Git LFS, which stores pointers in Git and data in separate storage. It works, but quotas and bandwidth rules vary by host and plan, so check them before you commit large files. Rewriting history to remove an accidentally committed checkpoint is painful, so set up .gitattributes rules before the first one lands — the workflow I walk through in Git hosting for large ML files.
DVC and Object Storage
DVC keeps small metafiles in Git and stores data in your own S3, GCS, Azure, or similar bucket, which gives you control over location and cost. Pair it with your cloud's access controls and encryption. I covered the workflow in data versioning with DVC.
Experiment Trackers and Registries
Tools like MLflow handle experiment tracking and model registries separately from Git. Don't force Git to do that job. Use Git for code and config, and let a tracker log metrics and artifacts.
Quick Comparison
- GitLab: best all-in-one platform with strong CI and a self-managed path.
- Gitea: best lightweight self-hosted forge with a vendor behind it.
- Forgejo: best community-governed self-hosting, with GitHub Actions-style workflows.
- Bitbucket: best for Jira-centred teams.
- Codeberg: best for open source — not private ML work.
- Hugging Face Hub: best for large model and dataset storage with ML-aware tooling.
- DVC with object storage: best for control over data location and cost.
- Git LFS: best for modest large-file needs inside your existing host.
How to Choose
Skip the feature tables. Start with four questions.
1. Who Controls the Data?
Regulated data, client contracts, or export rules may require self-hosting or a specific region. If so, GitLab self-managed, Forgejo, or Gitea fit, and you accept the admin burden. Otherwise a managed service saves effort.
2. How Big Are Your Artifacts?
Under a few gigabytes of weights, Git LFS or your host's large-file support may do. Terabytes of datasets call for object storage, the Hub, or a dedicated data platform.
3. What CI Do You Need?
Training jobs usually need GPUs, which standard hosted runners do not provide. Plan self-hosted runners on your own GPU machines, and check how each platform registers and secures them, because a compromised runner leaks secrets. The trade-offs are in CI services for ML teams and CI/CD for machine learning.
4. How Much Admin Time Can You Spend?
Self-hosting gives control and costs time: upgrades, backups, monitoring, security patches. A three-person startup rarely wants that job. Match the tool to your team's real capacity, not your aspirations.
Security Basics for Private ML Repos
Private does not mean safe. Do these regardless of host:
- Keep secrets out of Git. Use environment variables or a secrets manager, and scan for leaked keys with tools like
gitleaks— my scanner roundup covers the rest. - Enable two-factor authentication and SSO where available.
- Use branch protection and required reviews on main.
- Limit access by role, including who can read datasets and weights.
- Audit runners and CI variables, because they are the highest-value target in the repo.
- Back up your repos, especially if you self-host.
- Vet third-party actions and extensions, since supply-chain attacks target developer tooling.
- Check your host's terms for data use and retention.
Weights and datasets can contain personal data. Treat them like source code at minimum.
Migration: Plan Your Exit Before You Enter
Moving hosts is easier when you plan for it. The Gitea and Forgejo migration tool moves issues, labels, the wiki, releases, and milestones, and needs a GitHub token to pull metadata and private repos [4]. Other platforms ship importers too. Test a migration with a small repo first.
Details people forget:
- CI configs — workflow syntax differs, so budget rewrite time.
- Webhooks — signature headers differ, so deploy triggers may need edits.
- LFS objects — confirm the data migrates, not just the pointers.
- Permissions and teams — these rarely transfer perfectly.
- Links and references — old issue and pull-request links may break.
Keep your build process portable. Containers and plain scripts move easily; platform-specific magic does not.
A Practical Setup I'd Recommend
For a small ML team that wants low friction:
- Host code on a managed Git platform with CI. GitLab is my default pick.
- Store large artifacts outside Git, using the Hub, DVC with a bucket, or Git LFS with clear quotas.
- Track experiments with a dedicated tool, not with Git tags.
- Run GPU jobs on self-hosted runners with locked-down access.
- Add secret scanning and branch protection on day one.
- Back up everything, including artifact storage.
- Document the exit plan while migration is still cheap.
Teams with strict data-control needs swap step 1 for a self-hosted Forgejo or GitLab instance and accept the admin work.
Common Pitfalls
- Committing large files straight to Git. Set up LFS or external storage before the first checkpoint.
- Treating private as secure. Leaked keys and over-broad access still hurt.
- Picking a host for open-source ideals. Codeberg is excellent, but it caps private content at 100 MB.
- Ignoring runner security. CI runners hold secrets and execute code.
- Underestimating self-hosting. Upgrades and backups never stop.
- Believing price tables. Plans, quotas, and CI pricing change; verify on vendor pages.
- Skipping the exit plan. Platform lock-in grows quietly.
- Mixing too many tools. Keep the stack small enough that a new teammate can follow it.
Most of these mistakes are about ignoring size, security, or exit cost — the three things a demo repo never teaches you.
Best Book to Read
| Cover | Book | Description | Get it |
|---|---|---|---|
![]() |
Machine Learning Engineering | production ML pipelines where versioned promotion, artifact storage, and traceability are first-class requirements rather than afterthoughts. | View on Amazon |
As an Amazon Associate I earn from qualifying purchases. Links on this page are affiliate links, and I may earn a commission at no extra cost to you.
Read it for the artifact and promotion chapters. They explain why the repo holds code while the weights live somewhere with a version and a hash.
Wrapping Up
There is no single best host. Use a Git platform for code and collaboration, keep big artifacts in storage built for them, and decide early about data control and CI. GitLab suits an all-in-one approach, Forgejo and Gitea suit self-hosting, and the Hugging Face Hub or object storage handles the heavy files.
Audit your current repo this week: find your largest files, check where secrets might hide, and write down your data-control requirements. If your host handles all three, stay put and enjoy the peace. If it does not, you just found a real reason to switch — and now you have a shortlist.
Frequently Asked Questions
What is the best GitHub alternative for private ML projects?
There is no single best host. GitLab suits an all-in-one platform with strong CI and a self-managed path. Forgejo and Gitea suit self-hosting, with community or vendor governance. Hugging Face Hub handles large model and dataset storage. Pick based on data-control needs, artifact size, and CI requirements.
Should I use Git LFS or Hugging Face Hub for model weights?
For a few gigabytes, Git LFS on your existing host works. For terabytes of datasets and weights, Hugging Face Hub's Xet storage deduplicates at the chunk level and integrates with ML tooling. DVC with your own S3 or GCS bucket gives maximum control over data location and cost.
Can I self-host GitLab for private ML repos?
Yes, GitLab self-managed is a common choice when regulations or client contracts require data to stay on your infrastructure. Budget admin time for upgrades, backups, monitoring, and security patches — a three-person startup rarely wants that job.
What happens to my CI/CD workflows when migrating from GitHub?
Workflow syntax differs between platforms. GitHub Actions YAML does not map one-to-one to GitLab CI, Forgejo Actions, or Gitea Actions. Budget rewrite time and test your real workflows before committing to a migration.
Does Codeberg work for private ML repositories?
No. Codeberg allows up to 100 MB of private content for contributors to free software projects, and it is built for open source. For private ML work with large artifacts, it is the wrong tool.
Sources
[1]Hugging Face, Hub storage limits — Xet vs Git LFS, the private storage table, add-on pricing, repository recommendations, and the LFS deletion warning: huggingface.co/docs/hub/storage-limits[2]GitLab, Pricing — free tier limits (5 users per top-level group, 400 compute minutes, 10 GiB) and Premium at $29 per user per month billed annually: about.gitlab.com/pricing[3]Codeberg, Documentation FAQ — the 100 MB private-content rule and the non-profit structure: docs.codeberg.org/getting-started/faq[4]Forgejo, FAQ — the fork from Gitea, governance, Actions compatibility, and the migration tool: forgejo.org/faq[5]Atlassian, Bitbucket — private repositories, Pipelines, and Jira integration: bitbucket.org/product
