New Git IPFS Remote

I’m working on a git remote that makes the stored repository accessible.

This version does not attempt to store the raw git blocks. As well as avoiding the block sharding problem that causes, this makes the content accessible.

When the repo is created, the root of the filesystem contains the branch that was pushed. The git info is stored in .git/ (structure).

I just created a simple example repo. Since it contains an index.html, that is displayed. To view the commits, see .git/vfs/commits/.

With the remote installed, the root hash is an acceptable argument to git clone ipfs://*hash*.

4 Likes

I worked with it a bit more and added IPNS support. The following now work:

  • ipfs key gen --type=rsa --size=2048 mysite
  • git remote add ipns ipns::key:mysite
  • git push ipns
  • git clone ipns://git-remote-ipfs.dhappy.org
1 Like

@dysbulic I’ve run into some issues trying to use this. Would it be possible for you to enable issue tracking on the github project and I can create an issue there?

I’d very much like to contribute to this going forward.

@craigmayhew, issues are now enabled. I look forward to your feedback.

What do you mean by “raw git blocks”? Does this understand git’s own hashes with the IPLD support for git, or does it rehash the data?

“git raw blocks” are the objects in .git/objects (decompressed).

Does this understand git’s own hashes with the IPLD support for git, or does it rehash the data?

It re-uses the hash but transforms it into a CID (wraps it in a SHA1 multihash, then in a CID with the GitRaw multicodec).

Thanks @stebalien, this works because JavaScript ipfs depends on ipld which in turn depends on ipld-git?