Skip to main content

Encrypted, peer-to-peer Git for two+ people.

Project description

Git With Me

I have a Git repository and I want to collaborate with others. We do not have a public server, and do not wish to use existing hosting services.

git withme provides a way for a single host to invite numerous peers with short, one-time secure codes. The peers connect directly via Dilated Magic Wormhole channels, allowing collaborators to git clone git://localhost/<repo-name>.

The FOWL Logo, a chicken head, mashed together with 4 Git logos connected by Ethernet cables, suggesting a host and 3 peers

Motivational Example

I have created a Git repository:

$ mkdir ~/src/gwm
$ cd ~/src/gmw
$ echo "Git With Me" > README
$ git add README
$ git commit -m "begin"

Now chatting with a friend, I invite them to collaborate. In its own shell, I run the hosting service; this will connect to the public Magic Wormhole mailbox server.

$ cd ~/src/gwm
$ git withme
Hosting /home/meejah/src/gwm (via bare repo /tmp/tmpx_y7q2iq/gitwithme_remote)
 ╭───────────────────────────────────────────────────────────────╮
 │ Hosting: /home/mike/src/git-withme                            │
 │ Git WithMe is now running. To push code to all peers, use:    │
 │     git push gitwithme                                        │
 │ ...and to receive code from a peer who has pushed, use:       │
 │     git pull gitwithme main                                   │
 │ The temporary bare repository we created will be deleted when │
 │ this process is terminated.                                   │
 │                                                               │
 │ N -- create new peer                                          │
 │ Q -- quit, terminate all peers                                │
 ╰───────────────────────────────────────────────────────────────╯
                      Peers
 ┌────────────────────────────────────────────┐
 │ Invite code: 4-quux-foo                    │
 │ run "git-withme accept 4-quux-foo" to join │
 └────────────────────────────────────────────┘

I now send the code 4-quux-foo to my friend. On their computer, they run the "accept" command (with the secret code) to begin collaborating.

$ git withme --repo ~/src/gwm accept 4-quux-foo
welcome ws://relay.magic-wormhole.io:4000/v1
Peer has connected.
  git:
  git: Cloning into '~/src/gwm'...
  git:
You can now use normal git commands in ~/src/gwm
"git pull": update from the host
"git push": push changes to the host

Meanwhile, I should see something like this on my side:

┌──────────────────────────────────────────────────────┐
│ Connected (for 58 seconds). 🙂 (last 58 seconds ago) │
└──────────────────────────────────────────────────────┘

As long as both of these shells -- the one on my computer, and the one on my friend's -- remain running they forward end-to-end encrypted traffic between our two computers. This means that my friend can pull (and push) code; we can use Git somewhat normally.

When the host terminates, the bare repository in $TMPDIR is removed.

One-Time Codes

Malicious actors (even the Mailbox server, if malicious or compromised) get a single guess at breaking the code; if they are wrong, the mailbox is destroyed and the legitimate recipient will notice (they get a "crowded" error). This gives us an identity-free, long-lived connection -- so long as we keep our shells running, we can put our laptops to sleep or otherwise move networks (note that if both sides are disconnected for more than 10 minutes, the connection will be terminated).

How to Install

git withme is a Git extension written in Python. To "install" it, the git-withme script needs to be somewhere on your PATH (for git withme to work).

I recommend using a "virtualenv" or "venv" to install into, or you can try pip install --user git-withme if that works for your platform. For a "venv":

$ python -m venv ~/gwm-venv
$ ~/gwm-venv/bin/pip install git+https://git.sr.ht/~meejah/git-withme
$ export ~/gwm-venv/bin:$PATH
$ git withme --help

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

git_withme-25.4.3.tar.gz (9.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

git_withme-25.4.3-py3-none-any.whl (10.7 kB view details)

Uploaded Python 3

File details

Details for the file git_withme-25.4.3.tar.gz.

File metadata

  • Download URL: git_withme-25.4.3.tar.gz
  • Upload date:
  • Size: 9.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.2

File hashes

Hashes for git_withme-25.4.3.tar.gz
Algorithm Hash digest
SHA256 cc6c9cb4c96f3b16a308a7c08a0e16ff56b4179a72f93aa8f9d87fe2b7cff6af
MD5 0ee9473f5a8bd0134153a225307e9ddd
BLAKE2b-256 1d352aa8e848a903a3882073f35923a0ddddd1735b948b5a0a76b852d4c1289d

See more details on using hashes here.

File details

Details for the file git_withme-25.4.3-py3-none-any.whl.

File metadata

  • Download URL: git_withme-25.4.3-py3-none-any.whl
  • Upload date:
  • Size: 10.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.2

File hashes

Hashes for git_withme-25.4.3-py3-none-any.whl
Algorithm Hash digest
SHA256 2f74c5f84ab404f6200296e7b13e89ddbb98f1aab9e72b454bb5b52488bc5ee4
MD5 630dfb31b8f1fadb39b842f17193baa5
BLAKE2b-256 e14d60374a264d96e6a49dcf99af842b59064294269093cdbfff3da1b7362681

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page