# Usage of private repo in build.zig.zon

**URL:** <https://ziggit.dev/t/usage-of-private-repo-in-build-zig-zon/2904>\
**Category:** Help\
**Tags:** package-management, build-system\
**Created:** [January 18, 2024, 1:44pm UTC](https://ziggit.dev/t/usage-of-private-repo-in-build-zig-zon/2904 "2024-01-18T13:44:10Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![ricknijhuis](https://ziggit.dev/user_avatar/ziggit.dev/ricknijhuis/32/1402_2.png) [@ricknijhuis](https://ziggit.dev/u/ricknijhuis)\
**Post date:** [January 18, 2024, 1:44pm UTC](https://ziggit.dev/t/usage-of-private-repo-in-build-zig-zon/2904/1 "2024-01-18T13:44:10Z")

</div>

Question is it possible to reference a private repo in the build.zig.zon file?  
Currently I am getting 404 unless I make the repo public.

I am using the latest build of zig.

---

<div class="post-metadata">

**Author:** ![tensorush](https://ziggit.dev/letter_avatar_proxy/v4/letter/t/6a8cbe/32.png) [@tensorush](https://ziggit.dev/u/tensorush)\
**Post date:** [January 18, 2024, 2:06pm UTC](https://ziggit.dev/t/usage-of-private-repo-in-build-zig-zon/2904/2 "2024-01-18T14:06:50Z")

</div>

No, at least not at the moment.

---

<div class="post-metadata">

**Author:** ![7R35C0](https://ziggit.dev/user_avatar/ziggit.dev/7r35c0/32/2393_2.png) [@7R35C0](https://ziggit.dev/u/7R35C0)\
**Post date:** [May 20, 2024, 11:40am UTC](https://ziggit.dev/t/usage-of-private-repo-in-build-zig-zon/2904/3 "2024-05-20T11:40:23Z")

</div>

Maybe a bit late and not with perfect solutions, but you can try with:

- a git submodule (or a simple project subfolder) and add the library in `build.zig.zon`:

- or, make a local archive with your code and:

- or, make an archive, store it in your email drive and:

More or less these are “testing” solutions, not very suitable for production.

---

<div class="post-metadata">

**Author:** ![fransafu](https://ziggit.dev/letter_avatar_proxy/v4/letter/f/2bfe46/32.png) [@fransafu](https://ziggit.dev/u/fransafu)\
**Post date:** [April 15, 2026, 6:40am UTC](https://ziggit.dev/t/usage-of-private-repo-in-build-zig-zon/2904/4 "2026-04-15T06:40:13Z")

</div>

I think this feature isn’t implemented yet. I’m working with v0.15.2, I know v0.16.0 was recently released. I need to check if there is a solution to import a private repo from a remote Git server.

At the moment, cloning the repo into my project and referencing it locally is a solution. Thinking about a release pipeline, something like cloning locally and building using references from the main project (which already has the dependency paths configured) could work, nothing serious, but if someone has a better approach for handling this in a CI/CD pipeline without hacking paths, that would be great.

---

<div class="post-metadata">

**Author:** ![Sze](https://ziggit.dev/user_avatar/ziggit.dev/sze/32/496_2.png) [@Sze](https://ziggit.dev/u/Sze)\
**Post date:** [April 15, 2026, 3:08pm UTC](https://ziggit.dev/t/usage-of-private-repo-in-build-zig-zon/2904/5 "2026-04-15T15:08:04Z")

</div>

[https://ziglang.org/download/0.16.0/release-notes.html#Fetch-Packages-Into-Project-Local-Directory](https://ziglang.org/download/0.16.0/release-notes.html#Fetch-Packages-Into-Project-Local-Directory)

---

<div class="post-metadata">

**Author:** ![fearedbliss](https://ziggit.dev/user_avatar/ziggit.dev/fearedbliss/32/8875_2.png) [@fearedbliss](https://ziggit.dev/u/fearedbliss)\
**Post date:** [April 15, 2026, 4:07pm UTC](https://ziggit.dev/t/usage-of-private-repo-in-build-zig-zon/2904/6 "2026-04-15T16:07:11Z")

</div>

I haven’t used any external packages in any of my Zig projects yet but if I did have a need for a private repository package, I would probably use the new `--fork` flag that `0.16.0` has and just reference it locally. That way I could generate a fingerprint for the package and have it be slightly more integrated into the build system than if I didn’t use `--fork`. Not the most convenient but not a blocker either.

---

<div class="post-metadata">

**Author:** ![fransafu](https://ziggit.dev/letter_avatar_proxy/v4/letter/f/2bfe46/32.png) [@fransafu](https://ziggit.dev/u/fransafu)\
**Post date:** [April 15, 2026, 7:32pm UTC](https://ziggit.dev/t/usage-of-private-repo-in-build-zig-zon/2904/7 "2026-04-15T19:32:38Z")

</div>

Thank you! I’ll try it

---

<div class="post-metadata">

**Author:** ![fransafu](https://ziggit.dev/letter_avatar_proxy/v4/letter/f/2bfe46/32.png) [@fransafu](https://ziggit.dev/u/fransafu)\
**Post date:** [April 15, 2026, 7:34pm UTC](https://ziggit.dev/t/usage-of-private-repo-in-build-zig-zon/2904/8 "2026-04-15T19:34:26Z")

</div>

Thanks! I’ll check the `--fork` flag, I think I found it here: [0.16.0 Release Notes ⚡ The Zig Programming Language](https://ziglang.org/download/0.16.0/release-notes.html#Ability-to-Override-Packages-Locally)
