Nutstone.GitHub.Service.Provider
1.1.3
See the version list below for details.
dotnet add package Nutstone.GitHub.Service.Provider --version 1.1.3
NuGet\Install-Package Nutstone.GitHub.Service.Provider -Version 1.1.3
<PackageReference Include="Nutstone.GitHub.Service.Provider" Version="1.1.3" />
<PackageVersion Include="Nutstone.GitHub.Service.Provider" Version="1.1.3" />
<PackageReference Include="Nutstone.GitHub.Service.Provider" />
paket add Nutstone.GitHub.Service.Provider --version 1.1.3
#r "nuget: Nutstone.GitHub.Service.Provider, 1.1.3"
#addin nuget:?package=Nutstone.GitHub.Service.Provider&version=1.1.3
#tool nuget:?package=Nutstone.GitHub.Service.Provider&version=1.1.3
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
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 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 |
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 | Versions 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. |
-
net8.0
- LibGit2Sharp (>= 0.31.0)
- LibGit2Sharp.NativeBinaries (>= 2.0.323)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 8.0.0)
- Nutstone.Readme.Provider (>= 1.0.0)
- YamlDotNet (>= 16.3.0)
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 |