Garrard.GitLab
0.0.11
See the version list below for details.
dotnet add package Garrard.GitLab --version 0.0.11
NuGet\Install-Package Garrard.GitLab -Version 0.0.11
<PackageReference Include="Garrard.GitLab" Version="0.0.11" />
<PackageVersion Include="Garrard.GitLab" Version="0.0.11" />
<PackageReference Include="Garrard.GitLab" />
paket add Garrard.GitLab --version 0.0.11
#r "nuget: Garrard.GitLab, 0.0.11"
#addin nuget:?package=Garrard.GitLab&version=0.0.11
#tool nuget:?package=Garrard.GitLab&version=0.0.11
Garrard.GitLab
Garrard.GitLab is a .NET library that provides operations for working with GitLab projects.
Installation
To install Garrard.GitLab
, you can use the NuGet package manager. Run the following command in the Package Manager Console:
Install-Package Garrard.GitLab -Version 0.0.11
Or add the following package reference to your project file:
<PackageReference Include="Garrard.GitLab" Version="0.0.11" />
Or use the dotnet add command:
dotnet add package Garrard.GitLab --version 0.0.11
Usage
Here is an example of how to use Garrard.GitLab in your project:
using Garrard.GitLab;
class Program
{
static async Task Main(string[] args)
{
// Example usage of GitLab.GitOperations, GitLab.FileOperations
var projectCreation = await GitOperations.CreateGitLabProject("new-project-name", "your-gitlab-pat", "gitlab-domain", projectName =>
{
Console.WriteLine($" - {projectName} exists, establishing an available project name...");
}, "group-id-or-omit-to-add-to-users-namespace");
if (projectCreation.IsFailure)
{
Console.WriteLine($"{projectCreation.Error}. Exiting...");
return;
}
// will use the new name (will have changed if couldn't use the original name)
newProjectName = projectCreation.Value;
GitOperations.DownloadGitRepository("https://github.com/yourusername/your-repo.git", "/path/to/download/to", "branch-name", "pat");
GitOperations.CloneGitLabProject("https://gitlab.com/yourusername/your-project.git", "/path/to/clone", "pat");
FileOperations.CopyFiles("/path/to/download/to", "/path/to/clone");
GitOperations.BranchCommitPushChanges("/path/to/clone", "commit message", "branch-name-or-omit-to-use-mainline-branch");
FileOperations.RemoveTempFolder("/path/to/download/to");
}
}
Features
- Create a new GitLab project
- It will create a unique project (by incrementing a number after your suggested name) if your suggested name exists
- It will by default add the project to your user's namespace. If you supply a groupID, it will add the project to this group instead
- Download an existing git repository
- You can provide branch name
- You can provide a PAT (uses oauth2)
- Clone GitLab project
- You can provide a PAT (uses oauth2)
- Copy files from cloned repo (or Project) to your new GitLab project folder (excluding the .git/ folder)
- Branch (optional), Commit and push changes
- Remove temporary folder
Contributing
Contributions are welcome! Please open an issue or submit a pull request on GitHub.
License
This project is licensed under the MIT License. See the LICENSE file for more details.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net9.0 is compatible. 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. |
-
net9.0
- CSharpFunctionalExtensions (>= 3.5.1)
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 |
---|---|---|
0.0.20 | 132 | 3/29/2025 |
0.0.19 | 164 | 3/27/2025 |
0.0.18 | 470 | 3/26/2025 |
0.0.17 | 162 | 3/19/2025 |
0.0.16 | 153 | 3/18/2025 |
0.0.15 | 217 | 3/7/2025 |
0.0.14 | 224 | 3/5/2025 |
0.0.13 | 202 | 3/5/2025 |
0.0.12 | 315 | 3/3/2025 |
0.0.11 | 144 | 3/3/2025 |
0.0.10 | 115 | 3/2/2025 |
0.0.9 | 114 | 3/2/2025 |
0.0.8 | 105 | 3/2/2025 |
0.0.7 | 89 | 3/2/2025 |
0.0.1 | 129 | 3/8/2025 |
Please refer to the README