Skip to content
No description or website provided.
Go Makefile
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.

GoDoc Build Status Go Report Card


This library abstracts read and write access to a set of go-git repositories. It comes with several implementations to support different storage methods:

  • plain: stored in the filesystem, supports transactions.
  • siva: rooted repositories in siva files, supports transactions. These files can be generated with gitcollector.
  • legacysiva: siva file generated by borges. This implementation only supports reading and does not support transactions.

When transactions are supported the writes to the repositories will be atomic and could only be seen by new readers when Commit function is called. That is, after opening a repository in read only mode any writes to it by another thread or process won't modify its contents. This is useful when the storage that is being used for reading repositories is being updated at the same time. More information and example in siva package documentation.


go-borges supports go modules and can be added to your project with:

$ go get

Example of utilization

This example lists the repositories downloaded by gitcollector.

package main

import (


func main() {
	if len(os.Args) != 2 {
		fmt.Println("you need to provide the path of your siva files")
	fs := osfs.New(os.Args[1])

	lib, err := siva.NewLibrary("library", fs, &siva.LibraryOptions{
		Bucket:        2,
		RootedRepo:    true,
		Transactional: true,
	if err != nil {

	repos, err := lib.Repositories(borges.ReadOnlyMode)
	if err != nil {

	err = repos.ForEach(func(r borges.Repository) error {
		id := r.ID().String()
		head, err := r.R().Head()
		if err != nil {
			return err

		fmt.Printf("repository: %v, HEAD: %v\n", id, head.Hash().String())
		return nil


Contributions are more than welcome, if you are interested please take a look to our Contributing Guidelines.

Code of Conduct

All activities under source{d} projects are governed by the source{d} code of conduct.


Apache License Version 2.0, see LICENSE.

You can’t perform that action at this time.