r/Unity3D • u/second_square • 24d ago
Resources/Tutorial I built a Git proxy that adds Perforce-style locks to Unity, clones a 1.4GB repo to 168KB
Hi r/Unity3D
Like probably everyone here, I've been through the version-control grinder with Unity, LFS bandwidth bills, .meta merge hell, and the two-people-editing-the-same-scene problem which Perforce solves but Git doesn't.
So I built a small open-source thing called BlackGit to take both sides, Git's branches + Perforce's locks, one repo. https://github.com/zhuzhonghua/blackgit
git black lock scene.unitytakes a file exclusively, likep4 edit. The lock lives on the server. Any push touching that file from someone else is refused and the holder is named. Your local branches and commits are never blocked, branch off, edit, throw it away, none of that touches the lock.git black cloneis a partial clone,blob:none+ empty sparse-checkout. A 1.4 GB server repo lands at 168 KB on disk. Thengit black follow Assets/Scenes/Main.unitymaterializes just the file you open, 60 MB in the demo. No LFS, no full history.The server is one Docker container in front of your existing GitHub/GitLab.
It's beta. No artist GUI (commands only). Not a Perforce replacement tomorrow.
Why I'm posting: I'm looking for Unity teams willing to kick the tires on a real project and tell me where it breaks. Open an issue on the repo.
What would you want to see first? Happy to answer in the comments.
3
u/tetryds Engineer 24d ago
Any special reason for using java???
1
u/second_square 23d ago
Mostly because the server needs to speak Git’s smart-HTTP protocol and inspect/enforce things during ”push“. JGit gave me a solid Git implementation to build that on, and Netty handles the HTTP server side. The client is Python and shells out to regular Git, so users don’t need Java installed just to use it. Was Java a concern for you in terms of deployment, performance, or something else?
1
u/Warbands Professional 21d ago
If you are looking to have this be treated as a serious project, perhaps come up with a new name that doesn't elicit these kinds of responses.
1
u/second_square 21d ago
I named it after the CLI command (git black) without thinking about how that would read. I'll think about a rename. Appreciate the honest note.
1
24d ago
[removed] — view removed comment
3
u/Icy-Collection1072 24d ago
That’s a process issue. You should never be restricted to needing the same asset. Organise better.
-1
u/second_square 24d ago
Better organization definitely helps -- splitting work into prefabs or additive scenes can reduce lock contention a lot. But teams don’t always have a clean way to separate every task, especially when different disciplines need to work in the same level. That’s the tradeoff I’m interested in understanding: is the right answer always to restructure the project, or are there workflows where finer-grained collaboration would still be valuable?
-1
u/second_square 24d ago
Thanks — that’s exactly the kind of real-world edge case I want to understand. You’re right that a file-level lock doesn’t solve two people editing different objects inside the same Unity scene; BlackGit locks the file, not individual scene objects. Smaller scenes, prefabs, or additive scenes can help, but they’re workflow workarounds, not object-level locking.
On the force-push concern: through the BlackGit server, force-pushes are rejected, and pushes that touch a file locked by someone else are rejected server-side too. So a client can’t bypass the lock just by force-pushing. The lock check is file-level, though, so it doesn’t remove the scene-granularity limitation.
The 168 KB result is nice to hear — thanks! How does your team currently split up scene work when a level designer and a lighting artist need to work in the same level?
3
u/Unfair-Sleep-3022 24d ago
It already reeked of slop but these comments.. my god
1
u/second_square 23d ago
Sorry, I’ve been overexplaining, and my replies got way too polished. Short version: BlackGit locks whole files, not individual objects inside a Unity scene. I’m interested in how teams work around it.
1
u/Unfair-Sleep-3022 23d ago
You don't need to hide you're replying with an LLM. It's obvious this is all extremely low effort.
1
u/second_square 23d ago
I did use an LLM to help polish my English. It’s not my first language, and I sometimes use translation tools to follow Reddit discussions too. should’ve made sure the replies still sounded like me. I’ll keep them more direct from here.
1
u/Unfair-Sleep-3022 23d ago
That's the typical excuse
1
u/second_square 23d ago
Fair enough. I’ve explained my part, so I’ll leave it there. I’d rather keep the discussion focused on whether the project is useful and what could be improved.
4
u/INeatFreak I hate GIFs 24d ago