npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

git-remote-ipfs

v0.3.23

Published

Git remote that decomposes objects to and from IPFS.

Downloads

3

Readme

IGiS Logo Interplanetary Filesystem (IPFS) Git Remote Helper

Push and fetch commits to IPFS. To use the IOTA tangle to distribute the most recent version of a repo, see git-remote-ipfs+mam.

🐞 Bug 🐞

It is possible to push tags to IPFS, but when cloning a repo that contains tags you'll get the error: fatal: BUG: initial ref transaction called with existing refs.

The issue is known and is being investigated.

Installation

  1. Install ipfs-desktop or another IPFS daemon
  2. npm install --global git-remote-ipfs

Usage

(Insecure) Cloud Backup

  1. git push ipfs://projectname --all # you can't push all and tags at the same time
  2. git push ipfs::<CID from Step #1> --tags master # the pushed branch becomes the root of the filesystem
  3. Pin the resultant hash on a pinning service.

Note that #2 uses the CID produced by #1. When a CID is provided for a push, the push will add changes to that repository maintaining some information such as the name and uuid.

Push master with tags and get an IPFS CID back:

git push --tags ipfs:: master

Pull a commit:

git pull ipfs::Qma5iwyvJqxzHqCT9aqyc7dxZXXGoDeSUyPYFqkCWGJw92

Clone a repository:

git clone ipfs::Qma5iwyvJqxzHqCT9aqyc7dxZXXGoDeSUyPYFqkCWGJw92 repo

Create a repo named "myproject" and show debugging info:

DEBUG=t git push ipfs://myproject

Overview

This remote serializes a Git commit tree to a CBOR-DAG stored in IPFS. The root of the generated filesystem is the branch that was last pushed.

Generated File Structure

  • /: the contents of the branch that was pushed
  • .git/: CBOR-DAG representing a git repository
  • .git/HEAD: string entry denoting the current default branch
  • .git/uuid: UUIDv1 identifier that stays constant across pushes
  • .git/refs/(heads|tags)/*: Pointers to commit objects

Each commit then has:

  • parents: The commit's parent commits
  • (author|committer): The commits author and committer signatures
  • gpgsig: Optional signature for the commit
  • tree: The filesystem state at the time of this commit
  • modes: tree is an IPFS Protobuffer-UnixFS DAG which is browsable through the web, but can't store the file mode information, so this is that info.

IPLD Git Remote

Integrating Git and IPFS has been on ongoing work with several solutions over the years. The predecessor to this one stored the raw blocks in the IPFS DAG using a multihash version of git's SHA1s.

The SHA1 keys used by Git aren't exactly for the hash of the object. Each git object is prefaced with a header of the format: "#{type} #{size}\x00". So a Blob in Git is this header plus the file contents.

Because the IPLD remote stores the raw Git blocks, the file data is fully present, but unreadable because of the header.

Troubleshooting

It is safe to delete .git/remote-igis/cache/ though it will require regenerating all the commits which could take some time.

License

MIT