CakeExt.Git
3.0.0
dotnet add package CakeExt.Git --version 3.0.0
NuGet\Install-Package CakeExt.Git -Version 3.0.0
<PackageReference Include="CakeExt.Git" Version="3.0.0" />
<PackageVersion Include="CakeExt.Git" Version="3.0.0" />
<PackageReference Include="CakeExt.Git" />
paket add CakeExt.Git --version 3.0.0
#r "nuget: CakeExt.Git, 3.0.0"
#:package CakeExt.Git@3.0.0
#addin nuget:?package=CakeExt.Git&version=3.0.0
#tool nuget:?package=CakeExt.Git&version=3.0.0
cake-git-ext-plugin
Overview
CakeExt.Git is a set of Cake build script extensions that provide additional functionality for working with Git commands beyond what is included in the Cake.Git extension. These extensions aim to simplify the integration of Git-related tasks, especially for handling of changes between two commits into your Cake build scripts.
Git
Executes a Git command and returns the output as an IEnumerable<string>.
ICakeContext context;
var output = context.Git("your-git-command-here");
GitGetLastCommitMessage
Returns the last commit message as a string.
ICakeContext context;
var lastCommitMessage = context.GitGetLastCommitMessage();
GitGetBranchName
Gets the current branch name.
ICakeContext context;
var branchName = context.GitGetBranchName();
Change Detection
GitMergeBase
Gets the merge base between the current branch and a specified remote branch.
If the current branch is the main branch, the merge base is the latest commit on the remote branch. If the current branch is not the main branch, the merge base is the latest commit on the main branch that is also on the current branch.
ICakeContext context;
var mergeBase = context.GitMergeBase("your-remote", "your-main-branch");
GitRevHead
Gets the revision head commit id.
ICakeContext context;
var revHead = context.GitRevHead();
GitDiff
Gets the filenames of the changes between two commits.
ICakeContext context;
var changes = context.GitDiff("commit-hash-1", "commit-hash-2");
GitGetChanges
Gets the changed files between the current commit and the merge base.
ICakeContext context;
var changes = context.GitGetChanges("your-remote", "your-main-branch");
GitGetChangeMatchPattern
Checks if any of the changed files match a given regex pattern.
ICakeContext context;
var hasMatch = context.GitGetChangeMatchPattern(changes, "your-regex-pattern");
Usage
The package is published to the GitHub Packages NuGet registry. To use the package in your Cake build script project, you must add the GitHub Packages NuGet registry to your Cake build script project's NuGet.config file. For more information, see the following link:
Add the CakeExt.Git NuGet package to your Cake build script project.
#addin "nuget:?package=CakeExt.Git"
Import the namespace in your Cake build script.
using CakeExt.Git;
Use the provided aliases in your Cake build script as needed.
License
This project is licensed under the MIT License - see the LICENSE file for 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
- Cake.Common (>= 5.0.0)
- Cake.Core (>= 5.0.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 |
|---|---|---|
| 3.0.0 | 9,836 | 12/4/2024 |
| 2.0.0 | 21,451 | 10/14/2024 |
| 1.5.0 | 235 | 10/9/2024 |
| 1.0.5-tags-1-0-4.1 | 86 | 10/7/2024 |
| 1.0.4-tags-1-0-3.2 | 89 | 10/7/2024 |