Nutstone.GitHub.Service.Provider 1.1.8

There is a newer version of this package available.
See the version list below for details.
dotnet add package Nutstone.GitHub.Service.Provider --version 1.1.8
                    
NuGet\Install-Package Nutstone.GitHub.Service.Provider -Version 1.1.8
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Nutstone.GitHub.Service.Provider" Version="1.1.8" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Nutstone.GitHub.Service.Provider" Version="1.1.8" />
                    
Directory.Packages.props
<PackageReference Include="Nutstone.GitHub.Service.Provider" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Nutstone.GitHub.Service.Provider --version 1.1.8
                    
#r "nuget: Nutstone.GitHub.Service.Provider, 1.1.8"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#addin nuget:?package=Nutstone.GitHub.Service.Provider&version=1.1.8
                    
Install as a Cake Addin
#tool nuget:?package=Nutstone.GitHub.Service.Provider&version=1.1.8
                    
Install as a Cake Tool

GitHub.Service.Provider

Provides a library of methods to interact with local and remote git repositories. It uses the GTIHUB http api for remote repositories and LIB2GITSHARP for local repositories

It supports win-x64 and ubuntu 2.X

written in c# .net 8.0 (C) David Nuttall

Authentication

To access GITHUB methods it expects a GITHUB PAT token to be supplied (which is normally held in a local USER environmentvariable which , by default, is called 'GitToken'). OAuth is not currently supported

Usage

Virtualually all methods require a GitRequest object to be passed in as a parameter an example of which is :-

    gitRequest = GitRequest.Create()
                           .WithRepositoryName("remote repository name") // used for both remote and local repo names
                           .WithTokenFromEnvironmentVariable() // uses 'GitToken' en var by default 
                           .WithUser(testOwner) // or WithOrganisation 
                           .WithLocalRepositoryPath("root path to the local repository");
    
    var repoList = await GetRepositoryListAsync(gitRequest, (err, httpError) => {//do something}, (m) => {//verbose msg handler});                        

The library supports dependency injection and a static ServiceProvider method is supplied for registration.

      var serviceCollection = new ServiceCollection()
                                      .RegisterGitHub() // register github
                                      .yourregistrations

Category Visual Studio

Method Description
GetInstalledTools Returns a [DotNetToolLocalCollection]. A collection of dot net tools installed in the local user store
InstallDotnetTool Installs the given packid as a dot net tool to the local user store
GetTools Gets a [DotNetToolCollection]. of nuget dotnet tools with an optional Filter
GetProject Returns [VisualStudioProjectCollection]. A collection of visual studio projects
GetAvailableGroups Gets a list of labels associated with a projectgroup
UninstallDotNetTool Uninstalls the given package from the dot net tool local tool store
GetProjectsFromDocument Returns [VisualStudioProjectCollection]. A collection of visual studio projects from a .csproj

Category GitHub

Method Description
GetRepositoryList Returns a list of Repositories [GitRepositoryListCollection]
GetRepositoryListAsync Returns a list of Repositories [GitRepositoryListCollection]

Category Local Git

Method Description
Clone Clones a remote repository
CreateBranch Creates a new branch
Pull Pulls latest from remote
CreateTag Creates a tag
GetCommitsAsync Returns a list of commits [GitCommitCollection]
GetCommits Returns a list of commits [GitCommitCollection]
GetLatestCommitAsync Returns the last commit
GetLatestCommit Returns the last commit
IsLocalRepoLatestCommitAsync Compares the local last connit with the remote
CheckoutBranch Checks out a branch. If the branch does not exist - it is created
IsLocalRepoLatestCommit Compares the local last connit with the remote

GetInstalledTools

Returns a [DotNetToolLocalCollection]. A collection of dot net tools installed in the local user store

Returns DotNetToolLocalCollection

var DotNetToolLocalCollectionResult = GetInstalledTools(msgHandler);

** Parameters **

msgHandler

Type: [Action<IEnumerable`1>] Default: Not Applicable


InstallDotnetTool

Installs the given packid as a dot net tool to the local user store

Returns Int32

var Int32Result = InstallDotnetTool(packageId, msgHandler);

** Parameters **

packageId

Type: [String] Default: Not Applicable

msgHandler

Type: [Action<IEnumerable`1>] Default: Not Applicable


GetTools

Gets a [DotNetToolCollection]. of nuget dotnet tools with an optional Filter

Returns DotNetToolCollection

var DotNetToolCollectionResult = GetTools(filter);

** Parameters **

filter

Type: [String?] Default:


GetProject

Returns [VisualStudioProjectCollection]. A collection of visual studio projects

Returns VisualStudioProjectCollection

var VisualStudioProjectCollectionResult = GetProject(projectPath);

** Parameters **

projectPath

Type: [String] Default: Not Applicable


GetAvailableGroups

Gets a list of labels associated with a projectgroup

Returns IEnumerable`1

var IEnumerable`1Result = GetAvailableGroups();

** Parameters **


UninstallDotNetTool

Uninstalls the given package from the dot net tool local tool store

Returns Int32

var Int32Result = UninstallDotNetTool(packageId, msgHandler);

** Parameters **

packageId

Type: [String] Default: Not Applicable

msgHandler

Type: [Action<IEnumerable`1>] Default: Not Applicable


GetProjectsFromDocument

Returns [VisualStudioProjectCollection]. A collection of visual studio projects from a .csproj

Returns VisualStudioProjectCollection

var VisualStudioProjectCollectionResult = GetProjectsFromDocument(document, projectPath);

** Parameters **

document

Type: [XDocument] Default: Not Applicable

projectPath

Type: [String] Default: Not Applicable


GetRepositoryList

Returns a list of Repositories [GitRepositoryListCollection]

Returns GitRepositoryListCollection

var GitRepositoryListCollectionResult = GetRepositoryList(gitRequest, errorResponse, msgHandler);

** Parameters **

gitRequest

Type: GitRequest Default: Not Applicable

errorResponse

Type: [Action<String, HttpResponseMessage>] Default: Not Applicable

msgHandler

Type: [Action<String>?] Default:


GetRepositoryListAsync

Returns a list of Repositories [GitRepositoryListCollection]

Returns GitRepositoryListCollection

var GitRepositoryListCollectionResult = await GetRepositoryListAsync(gitRequest, errorResponse, msgHandler);

** Parameters **

gitRequest

Type: GitRequest Default: Not Applicable

errorResponse

Type: [Action<String, HttpResponseMessage>] Default: Not Applicable

msgHandler

Type: [Action<String>?] Default:


Clone

Clones a remote repository

Returns Boolean

var BooleanResult = Clone(request, progressHandler, errorHandler, msgHandler);

** Parameters **

request

Type: GitRequest Default: Not Applicable

progressHandler

Type: [Action<CloneProgress>] Default: Not Applicable

errorHandler

Type: [Action<Exception>] Default: Not Applicable

msgHandler

Type: [Action<String>?] Default:


CreateBranch

Creates a new branch

Returns Boolean

var BooleanResult = CreateBranch(request, errorHandler, msgHandler);

** Parameters **

request

Type: GitRequest Default: Not Applicable

errorHandler

Type: [Action<String>] Default: Not Applicable

msgHandler

Type: [Action<String>?] Default:


Pull

Pulls latest from remote

Returns MergeStatus

var MergeStatusResult = Pull(request, errorHAndler, msgHandler);

** Parameters **

request

Type: GitRequest Default: Not Applicable

errorHAndler

Type: [Action<String>] Default: Not Applicable

msgHandler

Type: [Action<String>?] Default:


CreateTag

Creates a tag

Returns Boolean

var BooleanResult = CreateTag(request, tagName, releaseNote, errorHandler, msgHandler);

** Parameters **

request

Type: GitRequest Default: Not Applicable

tagName

Type: [String] Default: Not Applicable

releaseNote

Type: [String] Default: Not Applicable

errorHandler

Type: [Action<String>] Default: Not Applicable

msgHandler

Type: [Action<String>?] Default:


GetCommitsAsync

Returns a list of commits [GitCommitCollection]

Returns GitCommitCollection

var GitCommitCollectionResult = await GetCommitsAsync(gitRequest, errorResponse, msgHandler);

** Parameters **

gitRequest

Type: GitRequest Default: Not Applicable

errorResponse

Type: [Action<String, HttpResponseMessage>] Default: Not Applicable

msgHandler

Type: [Action<String>?] Default:


GetCommits

Returns a list of commits [GitCommitCollection]

Returns GitCommitCollection

var GitCommitCollectionResult = GetCommits(gitRequest, errorResponse, msgHandler);

** Parameters **

gitRequest

Type: GitRequest Default: Not Applicable

errorResponse

Type: [Action<String, HttpResponseMessage>] Default: Not Applicable

msgHandler

Type: [Action<String>?] Default:


GetLatestCommitAsync

Returns the last commit

Returns String

var StringResult = await GetLatestCommitAsync(gitRequest, errorResponse, msgHandler);

** Parameters **

gitRequest

Type: GitRequest Default: Not Applicable

errorResponse

Type: [Action<String, HttpResponseMessage>] Default: Not Applicable

msgHandler

Type: [Action<String>?] Default:


GetLatestCommit

Returns the last commit

Returns String

var StringResult = GetLatestCommit(gitRequest, errorResponse, msgHandler);

** Parameters **

gitRequest

Type: GitRequest Default: Not Applicable

errorResponse

Type: [Action<String, HttpResponseMessage>] Default: Not Applicable

msgHandler

Type: [Action<String>?] Default:


IsLocalRepoLatestCommitAsync

Compares the local last connit with the remote

Returns Boolean

var BooleanResult = await IsLocalRepoLatestCommitAsync(request, errorResponse, msgHandler);

** Parameters **

request

Type: GitRequest Default: Not Applicable

errorResponse

Type: [Action<String, HttpResponseMessage>] Default: Not Applicable

msgHandler

Type: [Action<String>?] Default:


CheckoutBranch

Checks out a branch. If the branch does not exist - it is created

Returns Boolean

var BooleanResult = CheckoutBranch(gitRequest, errorHandler, msgHandler);

** Parameters **

gitRequest

Type: GitRequest Default: Not Applicable

errorHandler

Type: [Action<String>] Default: Not Applicable

msgHandler

Type: [Action<String>?] Default:


IsLocalRepoLatestCommit

Compares the local last connit with the remote

Returns Boolean

var BooleanResult = IsLocalRepoLatestCommit(request, errorResponse, msgHandler);

** Parameters **

request

Type: GitRequest Default: Not Applicable

errorResponse

Type: [Action<String, HttpResponseMessage>] Default: Not Applicable

msgHandler

Type: [Action<String>?] Default:


Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.1.11 140 5/22/2025
1.1.10 140 5/21/2025
1.1.9 139 5/20/2025
1.1.8 138 5/19/2025
1.1.7 94 5/18/2025
1.1.6 100 5/18/2025
1.1.5 97 5/18/2025
1.1.4 197 5/16/2025
1.1.3 186 5/12/2025
1.1.2 131 5/11/2025
1.1.1 134 5/11/2025
1.1.0 72 5/10/2025
1.0.99 160 5/7/2025
1.0.98 140 5/7/2025
1.0.97 144 5/7/2025
1.0.96 142 5/5/2025
1.0.95 143 5/5/2025
1.0.94 142 5/4/2025
1.0.92 147 5/4/2025
1.0.13 98 5/4/2025
1.0.12 103 5/4/2025
1.0.11 74 5/3/2025
1.0.10 71 5/3/2025
1.0.9 72 5/3/2025
1.0.8 69 5/3/2025
1.0.7 121 5/2/2025
1.0.6 119 5/2/2025
1.0.5 124 5/2/2025
1.0.4 118 5/2/2025
1.0.3 119 5/2/2025
1.0.2 131 5/2/2025
1.0.1 154 4/23/2025