an experiment to make LibGit2Sharp more reactive
C# F# PowerShell
Latest commit 7556c2e Apr 6, 2015 @shiftkey Merge pull request #19 from shiftkey/bump-libgit2sharp
update all the dependencies


This is an experiment in combining Rx and LibGit2Sharp to create an API to make git operations friendly for asynchronous situations.

libgit2 operations are, by their nature, synchronous. This is reflected in the wrapper APIs such as LibGit2Sharp. This is great for simple interactions with repositories, but working with complex tasks against large repositories requires embracing asynchrony and pushing operations onto background threads.

Rather than create a duplicate set of asynchronous APIs for LibGit2Sharp, this project is intending to represent specific Git actions as a thing which can be observed. Many operations support cancellation, and this can be handled in ReactiveGit by simply disposing of the subscription to an observable action.

The other focus of this framework is around progress handlers, which LibGit2Sharp added support for recently. This enables a user to specify a callbacks to events in libgit2. By passing an observer to the operation in ReactiveGit, you can receive progress information in real-time to display in your application.


Install the package from NuGet!

Install-Package ReactiveGit


// many operations require authentication
CredentialsHandler credentials = (url, usernameFromUrl, types) =>
    new UsernamePasswordCredentials
        Username = "shiftkey-tester",
        Password = "haha-password"

// you can also pass an existing LibGit2Sharp repository here
var repository = new ObservableRepository(

// specify a progress observer to report progress
var pullObserver = new ReplaySubject<Tuple<string, int>>();
  next => Console.WriteLine("Progress: " + next.Item2));

// execute the operation
var pullResult = await repository.Pull(pullObserver);


If you'd like to get involved, check out the docs for more information.