Skip to content

cassiegroup/cassie-git-module

Repository files navigation

Git Module for .NET

Copy from gogs git module. https://github.com/gogs/git-module

nuget version

Package cassie-git-module is a .NET standard 2.0 module for Git access through shell commands.

Requirements

  • C# version must be at least 8.0.
  • Git version must be no less than 1.8.3. License This project is under the MIT License. See the LICENSE file for the full license text.

How to use?

Installation

dotnet add package cassie-git-module --version 0.8.3.2

Initial a project

    var repo = new Repository();
    await repo.Init(path,new InitOptions{Timeout=20,Bare=true});

Clone a project

    var repo = new Repository();
    await repo.Clone(url,dest,new CloneOptions{Timeout=20});

Fetch

    var repo = new Repository([Your Repo Path]);
    await repo.Fetch(new FetchOptions{Timeout=20});

Pull

    var repo = new Repository([Your Repo Path]);
    await repo.Pull(new PullOptions{Timeout=20});

Push

    var repo = new Repository([Your Repo Path]);
    await repo.Push(new PullOptions{Timeout=20});

Push

    var repo = new Repository([Your Repo Path]);
    await repo.Push(remote,branch,new PushOptions{Timeout=20});

Checkout

    var repo = new Repository([Your Repo Path]);
    await repo.Checkout(branch,new CheckoutOptions{Timeout=20});

...

For details, You can reference the assie.git.module.test project to use this SDK.