Is there a way to hard-link all duplicate objects in a folder containing multiple Git repositories?
Explanation:
I host a git server on my company’s server (on a Linux machine). The idea is to have a basic canonical repository, to which each user does not have forced access, but each user forks the canonical repository (clones the canonical into the user's home directory, thereby actually creating hard links).
/ canonical / Repo / Dev1 / Repo (objects tightly associated with / canonical / Repo during initial cloning) / Dev2 / Repo (objects related to / canonical / Repo during initial cloning)
This all works great. The problem occurs when:
Dev1: puts a huge commit in its fork on the server (/ Dev1 / Repo) Dev2: selects it on its local system, makes its own changes and puts it in its own fork on the server (/ Dev2 / Repo)
(Now the same "huge" file is located in both branches of the developer on the server. It does not automatically create a hard link.)
It swallows up my server space like crazy!
How can I create hard links between objects that are duplicate between two forks or canonical in this regard, so that server space is saved and each developer gets all the data when cloning from his fork on his local computer?