A method for vendoring git dependencies into the host repository using git namespaces, so that installation from git remotes resolves using the local git namespaces rather than over the network. This makes installs faster, eliminates dependency on upstream availability, protects against remote force-pushes rewriting history, and protects against link rot rendering a package unbuildable.
Git namespaces allow us to treat a prefix under refs/namespaces/<n> as a remote repository root. This enables us to mirror a foreign repository into that prefix on our local repository: head, branches, tags, notes, replacements, and any other refs the remote exposes. The underlying objects (commits, trees, blobs) are deduplicated into the shared object store. Git invoked via git --namespace=<ns> or GIT_NAMESPACE=<ns> treats refs/namespaces/<ns>/ as the ref root for operations against remote URLs.
By configuring git's url.*.insteadOf rules to rewrite a git dependency's re