ngit
nostr plugin for git
clone a nostr repository, or add as a remote, by using the url format nostr://<npub123|nip05-address>/
remote branches beginning with
pr/are open PRs from contributors;ngit listcan be used to view all PRsto open a PR, push a branch with the prefix
pr/or usengit sendfor advanced optionspublish a repository to nostr with
ngit init
browse gitworkshop.dev/repos to find nostr repositories.
install
install options:
live on the edge with one-line install:
curl -Ls https://ngit.dev/install.sh | bashbuild from source: clone this repository, install rust and cargo, checkout the latest release tag, run
cargo build --releaseand move./target/release/ngitand./target/release/git-remote-nostrto your PATH.install with cargo: install rust and cargo, run
cargo install ngit, maken sure~/.cargo/binis in your PATHinstall with nix: add
ngit.url = "github:DanConwayDev/ngit-cli";as a flake input and then includeinputs.ngit.packages."${pkgs.system}".defaultin packages.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.
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.
eg self-hosted, github, codeberg, etc.
┌──────────┐
│ Author │
└──/─┬─\───┘
,------' │ '--------.-------.
┌──────▼─┐ ┌────▼───┐ ┌───▼───┐ ┌─▼─────┐ ┌───────┐
│ Git │ │ Git │ │ Relay │ │ Relay │ │ Relay │
│ Server │ │ Server │ │ │ │ │ │ │
└────────┘ └────\───┘ └───┬───┘ └──/────┘ └─/─────┘
\------. │ ,----/---------/
┌─▼──▼──▼─┐
│ User │
└─────────┘