gnostr-ngit 948363.1875.7190

nostr plugin for git
docs.rs failed to build gnostr-ngit-948363.1875.7190
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Visit the last successful build: gnostr-ngit-1878.945702.534429

ngit

nostr plugin for git

  • clone a nostr repository, or add as a remote, by using the url format nostr://<npub123|nip05-address>/
  • ngit fetch --repo nostr://<npub123|nip05-address>/<identifier> accepts the full nostr repo URL form and uses the repo's configured relay defaults when available.
  • remote branches beginning with pr/ are open PRs from contributors; ngit list can be used to view all PRs
  • to open a PR, push a branch with the prefix pr/ or use ngit send for advanced options
  • publish a repository to nostr with ngit init

browse gitworkshop.dev/repos to find nostr repositories.

install

install options:

  1. live on the edge with one-line install: curl -Ls https://ngit.dev/install.sh | bash
  2. build from source: clone this repository, install rust and cargo, checkout the latest release tag, run cargo build --release and move ./target/release/ngit and ./target/release/git-remote-nostr to your PATH.
  3. install with cargo: install rust and cargo, run cargo install ngit, maken sure ~/.cargo/bin is in your PATH
  4. install with nix: add ngit.url = "github:DanConwayDev/ngit-cli"; as a flake input and then include inputs.ngit.packages."${pkgs.system}".default in packages.
  5. download the latest release binaries from gitworkshop.dev/ngit and add to PATH

run the commands ngit and git-remote-nostr to ensure the binaries are in your PATH.

feature flags

The crate exposes a nostr feature that re-exports the nostr crate from ngit::nostr with the DM-related features enabled. This keeps downstream code and internal tests on the same namespace while still allowing the feature to be turned on and off explicitly.

The helper script ./scripts/gnostr-ngit-tests.sh uses that feature by default, and also accepts --features, --all-features, and --no-default-features when you want to override the cargo feature set.

The git-notes tests now cover the full NIP-34 matrix: plain/mined commits, plain/mined notes, and plain/PoW note events.

contributions welcome!

gitworkshop.dev/danconwaydev.com/ngit to report issues and see PRs

use ngit to submit PRs with clone url: nostr://danconwaydev.com/relay.ngit.dev/ngit

primer

nostr is a decentralised communications protocol with:

  • permissionless account creation - created via a public/private key pair
  • verifiable signed messages
  • messages transported via relays rather than P2P

for code collaboration, nostr is used for:

  • repository identification and discovery
  • state (ie. git refs)
  • proposals (PRs), issues and related discussion

a git server is still required for data storage and syncing state. multiple git servers can be used for reduncancy and they can be seemlessly swapped out by maintainers just like nostr relays. see maintainer model for details on how multi-maintainer repositories work.

eg self-hosted, github, codeberg, etc.

             ┌──────────┐
             │  Author  │
             └──/─┬─\───┘
        ,------'  │  '--------.-------.
┌──────▼─┐   ┌────▼───┐   ┌───▼───┐  ┌─▼─────┐  ┌───────┐
│  Git   │   │  Git   │   │ Relay │  │ Relay │  │ Relay │
│ Server │   │ Server │   │       │  │       │  │       │
└────────┘   └────\───┘   └───┬───┘  └──/────┘  └─/─────┘
                   \------.   │   ,----/---------/
                         ┌─▼──▼──▼─┐
                         │  User   │
                         └─────────┘