Sjors Provoost

sjors@sprovoost.nl
I've read the git-nostr.dev site, its README and NIP-34. I haven't read its code, so this comparison is a first take. ngit: git-nostr covers the same ground. It speaks NIP-34, uses nostr://<nip05>/<identifier> clone URLs and has patches, PRs and forks from the terminal. It's written in Go, where ngit is in Rust. Both publish the same kind of repo announcement, so their repos and PRs should show up in each other's clients and on gitworkshop.dev, where git-nostr's own repo lives. One catch: both install a helper called git-remote-nostr and claim the nostr:// URL scheme. If you install both, whichever comes first on your PATH handles those URLs. grasp: this is where the design differs. In the ngit/grasp model, branch state is a signed Nostr event (kind 30618), and grasp servers accept pushes that match that event, with no login. git-nostr instead treats normal git hosts like GitHub as storage. You push with your existing git credentials, and Nostr holds the repo's address and the collaboration. The docs don't mention grasp at all. They don't say whether git-nostr publishes or checks state events either, so I can't tell whether a repo hosted only on grasp works with it. Iris git (git-remote-htree from hashtree) is a separate system. It uses htree://npub/repo URLs and stores git objects as hashtree/Blossom blobs, with optional P2P and private repos. Its docs don't mention NIP-34, so I wouldn't expect it to work with either of the other two. Daniel can say for sure whether grasp and 30618 support is there or planned. git-nostr.dev pkg.go.dev/git-nostr.dev github.com/nostr-protocol/nips/blob/master/34.md docs.rs/crate/git-remote-htree/latest/source/README.md
I hope to answer your questions in
Git Nostr ToolsHow Git Nostr Tools integrates NIP-34 into Git, from remotes and pull requests to state announcements that independent testers can subscribe to.Read the articleClose the article

A few days ago, I announced Git Nostr Tools. I expected someone to ask how the tools compare to and interact with ngit, grasp, and Iris git. The automated response misses the point in several respects, so I want to explain the internals and motivation behind the tools a little bit.

Like ngit and nak git, git-nostr implements NIP-34. It should not be surprising that all three tools cover the same grounds. Also, the fact that multiple tools "claim" the nostr:// URL scheme is not a conflict, but the whole purpose of a standardized protocol. It is not true that the git-nostr repository lives on GitWorkshop. While its code is hosted on GitHub, its NIP-34 metadata is stored on two independent relays. The GitWorkshop project page is merely one place to view that metadata.

The difference that matters when choosing a tool is how it fits into the way you want to use Git. My claim is that by leaving choices like where to host your repositories, what to name your branches, and which command aliases to use up to you, git-nostr can fit into a wider range of workflows.

Command-line integration

nak provides a git subcommand. To clone a NIP-34 repository from a nostr:// URI with nak, you run nak git clone. ngit, on the other hand, provides a git-remote-nostr helper, so to clone a nostr:// URI with ngit, you just run git clone. But for other operations, you sometimes have to use the ngit command instead.

In contrast, git-nostr adds both a nostr remote helper and a nostr subcommand to git. This allows you to easily use git's functionality to define aliases for commands that you often use and to encode your personal preferences, like:

git config --global alias.fork 'nostr fork --interactive'

It fully integrates into the git ecosystem. It uses git config for configuration, git credential for storing your key, and respects your preferred editor setting when it needs you to edit a file.

To demonstrate how git-nostr works, I want to guide you through a few common operations and explain what happens internally.

Repository and state announcements

Let's assume that Alice owns an open-source project on GitHub. She has configured her local clone such that she will fetch via HTTPS and push via SSH. git remote --verbose shows her:

origin	https://github.com/alice/widget.git (fetch)
origin	git@github.com:alice/widget.git (push)

The .git/config file in her clone contains:

[remote "origin"]
	url = https://github.com/alice/widget.git
	pushurl = git@github.com:alice/widget.git

Alice wants to announce her project on Nostr, because Bob wants to contribute and refuses to open an account on GitHub. So first Alice configures a relay:

git config --global --add nostr.relay wss://nos.lol

She then runs the following command inside the clone of her project:

git nostr init widget --interactive

She has to pick a project identity. git-nostr does not try to derive a project identity from the name of the working directory or the remote URL. She picks widget as the identity of her project. Because she uses the --interactive option, her preferred editor that she also uses for writing git commit messages will open a file where she can customize the human-readable name of the project, its description and some other metadata. As soon as she saves the file and closes the editor, she will be prompted for a Nostr key, because this is the first time that git-nostr has to sign an event. She pastes a bunker:// URL that she got from an app on her mobile phone.

In the background, git-nostr signs and publishes a Repository Announcement note (kind 30617) with the metadata that Alice provided and the HTTPS fetch URLs (plural, there might be multiple) in the clone tag. It will also replace all URLs of the remote to a single nostr:// address and for each pushurl it creates special pushinsteadof entries.

The .git/config file now contains:

[remote "origin"]
	url = nostr://<npub>/widget
[url "git@github.com:alice/widget.git"]
	pushinsteadof = https://github.com/alice/widget.git

And if Alice invokes git push, the following happens behind the scenes:

  1. git recognizes that the URL of the remote uses the nostr:// scheme, so it invokes git-remote-nostr and communicates with it over stdin/stdout. It tells the helper which URL to push to.
  2. git-remote-nostr resolves the Repository Announcement (kind 30617) from that address. It checks push permission and reads the clone tag. It then invokes git push with the first clone URL, but with GIT_PROTOCOL_FROM_USER=0 defined, because that URL was retrieved from the network.
  3. git recognizes that a pushinsteadof entry is defined for the HTTPS URL from the announcement, so the git objects will be transferred via SSH.
  4. Once the actual push was successful, git-remote-nostr reads the repository state from the remote (which will be retrieved via HTTPS, because it is not a push operation) and it will publish that information as Repository State Announcement (kind 30618).

Here is where you might notice a difference from GRASP. GRASP requires the Repository State Announcement (kind 30618) before the push, while git-nostr sends it after. This is something that needs to be kept in mind when adding GRASP support to git-nostr.

And you might also notice what is relevant to Iris Git: Iris Git uses Hashtree for repository storage and a separate git-remote-htree helper for htree:// URLs. But if you had a htree:// URL in the Repository Announcement (kind 30617) or in a pushinsteadof rule in your local configuration, the GIT_PROTOCOL_FROM_USER=0 variable would prevent git from using that helper unless you explicitly allow it by setting protocol.htree.allow to always.

Collaboration

While ngit automatically opens a PR whenever you push a branch that begins with pr/, git-nostr does not have any opinion about branch names. Opening a PR is always explicit:

git nostr pr open nostr://bob@nip05.me/widget

The destination of a PR can be any nostr:// URL or a remote that has a nostr:// URL. It defaults to upstream.

Behind the scenes, opening a PR sends a Pull Request note (kind 1618) and associates the branch with its nevent. So after Alice executed the above command while on the fix-build branch, her .git/config would contain:

[branch "fix-build"]
	remote = origin
	merge = refs/heads/fix-build
	nostr-pr = nevent1...

The branch's remote is origin, because that is where Alice pushes her changes. A branch can be associated with multiple PRs. It has one nostr-pr entry per associated PR.

If Alice pushes (potentially with --force) to a branch that is associated with one or more PRs, then git-remote-nostr (in addition to the stuff mentioned above) also sends a Pull Request Update note (kind 1619) for each associated PR.

Keep your existing workflow

git-nostr integrates NIP-34 into git, while staying out of your way where you don't want it to interfere. Host your source code and name your branches the way you like, be free to announce a project on Nostr or open a PR for a branch after it has been created, without the need to migrate anything.

This allows developers to collaborate on a feature of a project that is itself not announced on Nostr. They can send each other patches (kind 1617) and PRs (kinds 1618 and 1619) and once they agree with the state, open a PR on GitHub or wherever else upstream.

It also allows a project to start accepting Nostr issues and pull requests while GitHub continues to host the repository. It could then refer contributors to a page like GitWorkshop and disable pull requests on GitHub while keeping issues enabled, or vice versa. If their long-term plan was to get off GitHub, they could migrate issues, PRs, wiki, CI, and hosting on separate schedules.

Independent CI

In my talk Effective CTest at C++Now 2025, I advocated for a separation of responsibilities between project maintainers and build pipeline maintainers and I have my concerns about ngit's CI integration. To me, it looks like their goal is not to provide a decentralized development workflow like I described, but a decentralized version of GitHub, with all its feature bloat. I actually prefer the separation of concerns, which is also why I prefer native git with NIP-34 agnostic relays over GRASP.

Setting up a Nightly build for an arbitrary project and sending the build results to a dashboard was always possible and did not require permission from the project. This is what projects like VTK supported for 25 years. But what if you wanted to set up CI that builds for each opened PR or push to a particular branch? With GitHub, you would need to send a webhook to the tester, which only project maintainers can configure. With clients announcing the repository state (kind 30618), pull requests (kind 1618), and revisions (kind 1619), testers can simply listen for the appropriate events.

This article on Nostr

← More from Sjors Provoost