git ssb


cel / ssb-git-repo


cel committed 2.8.3Latest: ac55d70 on 6/8/2017, 2:09:58 PM


Host git repos in secure-scuttlebutt


var ssbGit = require('ssb-git-repo')
var repoId = '%CBeVWA9eYt6OhJDXFtqas6kWb5LwaJxYtfwDazKvh4U=.sha256'

// get a single repo:
ssbGit.getRepo(sbot, repoId, function (err, repo) {
  if (err) throw err
  // do something with the repo


ssbGit.createRepo(sbot[, options], cb(err, repo))

Create a repo. Publishes a message announcing the new repo.

ssbGit.getRepo(sbot, msgOrId[, options], cb(err, repo))

Get a repo.

ssbGit.repos(sbot, options): source(repo)

Get repos from the feed


An abstract-pull-git-repo-compliant git repo object. Additional methods and properties:

repo.private: boolean

Whether the repo is private (true), or public (false)

repo.recps: [feedId...]?

Feed ids that have access to the repo if it is private.


Close the repo's update stream.

repo.getHead(cb(err, head))

Get the repo's HEAD, i.e. the "default branch" ref, e.g. `"refs/heads/master"

repo.hasObjectQuick(hash) : has

Check for the presence of a commit hash, with possible false negatives.

This will only show an object as present if it was pushed in ssb-git-repo

= v1.9.0.

repo.getLatestAvailableRev(ref, timeout, cb(err, rev, numSkipped))

Get the latest revision for a ref that can be rendered. Try to retrieve the latest revision for a ref, and after a timeout try to retrieve the next latest, etc.


type: git-repo

{ type: 'git-repo' }

Creates a git repo. Note that you can actually push git objects to any message in your feed, but the git-repo type is here to declare that a message will be for a git repo. It may have properties added later.

type: git-update

  type: 'git-update',
  repo: MsgId,
  repoBranch: [ MsgId ]?,
  refsBranch: [ MsgId ]?,
  refs: { <ref>: String|null }?,
  packs: [ BlobLink ]?,
  indexes: [ BlobLink ]?,
  head: string?,
  commits: [ {
    sha1: String,
    title: String,
    body: String?,
    parents: [ String ]?,
  } ]?,
  tags: [ {
    sha1: String,
    object: String,
    type: String?,
    tag: String?,
  } ]?,
  commits_more: Number?,
  tags_more: Number?,
  num_objects: Number?,
  object_ids: [ String ]?,

Updates a repo. Published as a result of git push.


Copyright (c) 2016 Charles Lehner

Usage of the works is permitted provided that this instrument is retained with the works, so that any entity that uses the works is notified of this instrument.


Built with git-ssb-web