Garrard.GitLab
0.0.7
See the version list below for details.
dotnet add package Garrard.GitLab --version 0.0.7
NuGet\Install-Package Garrard.GitLab -Version 0.0.7
<PackageReference Include="Garrard.GitLab" Version="0.0.7" />
<PackageVersion Include="Garrard.GitLab" Version="0.0.7" />
<PackageReference Include="Garrard.GitLab" />
paket add Garrard.GitLab --version 0.0.7
#r "nuget: Garrard.GitLab, 0.0.7"
#addin nuget:?package=Garrard.GitLab&version=0.0.7
#tool nuget:?package=Garrard.GitLab&version=0.0.7
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.7
Or add the following package reference to your project file:
<PackageReference Include="Garrard.GitLab" Version="0.0.7" />
Or user the dotnet add command:
dotnet add package Garrard.GitLab --version 0.0.7
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...");
});
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");
GitOperations.CloneGitLabProject("https://gitlab.com/yourusername/your-project.git", "/path/to/clone");
FileOperations.CopyFiles("/path/to/download/to", "/path/to/clone");
GitOperations.BranchCommitPushChanges("/path/to/clone", "commit message", "branchname");
FileOperations.RemoveTempFolder("/path/to/download/to");
}
}
Features
- Create a new GitLab project (will create a unique project if your suggeted name exists)
- Download a existing git repository
- Clone GitLab project
- Copy files from cloned repo (or Project) to your new GitLab project folder (excluding the .git/ folder)
- Commit and pushes 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