https://github.com/aiursoftweb/gitrunner
Mirror of https://gitlab.aiursoft.cn/aiursoft/gitrunner
https://github.com/aiursoftweb/gitrunner
csharp dotnet git nuget runner wrapper
Last synced: 7 months ago
JSON representation
Mirror of https://gitlab.aiursoft.cn/aiursoft/gitrunner
- Host: GitHub
- URL: https://github.com/aiursoftweb/gitrunner
- Owner: AiursoftWeb
- License: other
- Created: 2023-11-24T07:15:11.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2025-01-02T17:41:05.000Z (over 1 year ago)
- Last Synced: 2025-01-06T05:02:49.020Z (over 1 year ago)
- Topics: csharp, dotnet, git, nuget, runner, wrapper
- Language: C#
- Homepage:
- Size: 107 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# GitRunner
[](https://gitlab.aiursoft.cn/aiursoft/gitrunner/-/blob/master/LICENSE)
[](https://gitlab.aiursoft.cn/aiursoft/gitrunner/-/pipelines)
[](https://gitlab.aiursoft.cn/aiursoft/gitrunner/-/pipelines)
[](https://www.nuget.org/packages/Aiursoft.gitrunner/)
[](https://gitlab.aiursoft.cn/aiursoft/gitrunner/-/commits/master?ref_type=heads)
GitRunner is a tool to help you run git commands in C#.
## Installation
To install `Aiursoft.GitRunner` to your project from [nuget.org](https://www.nuget.org/packages/Aiursoft.GitRunner/):
```bash
dotnet add package Aiursoft.GitRunner
```
## How to use
You can use this tool to Clone\Push\Commit git repositories.
```csharp
var serviceProvider = new ServiceCollection()
.AddLogging()
.AddGitRunner()
.BuildServiceProvider();
var repoPath = Path.Combine(Path.GetTempPath(), Guid.NewGuid().ToString());
Directory.CreateDirectory(repoPath);
var workspaceManager = serviceProvider.GetRequiredService();
await workspaceManager.Clone(
repoPath,
"master",
"https://gitlab.aiursoft.cn/aiursoft/gitrunner.git",
mode);
var branch = await workspaceManager.GetBranch(repoPath); // master
var remote = await workspaceManager.GetRemoteUrl(repoPath); // https://gitlab.aiursoft.cn/aiursoft/gitrunner.git
```
## How to contribute
There are many ways to contribute to the project: logging bugs, submitting pull requests, reporting issues, and creating suggestions.
Even if you with push rights on the repository, you should create a personal fork and create feature branches there when you need them. This keeps the main repository clean and your workflow cruft out of sight.
We're also interested in your feedback on the future of this project. You can submit a suggestion or feature request through the issue tracker. To make this process more effective, we're asking that these include more information to help define them more clearly.