Skip to content

Instantly share code, notes, and snippets.

@iansltx
Last active August 29, 2015 14:21
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save iansltx/8b986634ccc93090762b to your computer and use it in GitHub Desktop.
Save iansltx/8b986634ccc93090762b to your computer and use it in GitHub Desktop.
Local branch sharing

mDNS shows local machines

There are two network-related components of this utility: announce and pull. When you want to share a repo or branch with another user, you'll send an announcement to their host. That announcement will contain enough information to fetch the branch/repo from your system. When the targeted user receives the announcement, they can either ignore it or accept it. In the latter case, they may fetch the repo into its own new repo/branch or merge it with an existing local repo/branch via a temporary remote that lasts until they've finished pulling. If they want to share changes back with you, they announce the availability of a branch with the specified changes and you can accept/pull from them. Pushing from point to point (not counting the announcement) is not supported.

To allow for finer-grained ACLs, the announced remote is exposed via HTTP on a >1024 port with a set of credentials specific to a given announcement (which can contain exactly one repo or branch). The web server at this port will run for a limited time, which will be part of the information relayed in the announcement, after which the announcement expires and the repo becomes unavailable to pull from. In addition to the repo URL, credentials and TTL, the announcement includes a description, similar to the first line of a pull request on GitHub in intended usage.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment