CakeExt.Git 3.0.0

dotnet add package CakeExt.Git --version 3.0.0
                    
NuGet\Install-Package CakeExt.Git -Version 3.0.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="CakeExt.Git" Version="3.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="CakeExt.Git" Version="3.0.0" />
                    
Directory.Packages.props
<PackageReference Include="CakeExt.Git" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add CakeExt.Git --version 3.0.0
                    
#r "nuget: CakeExt.Git, 3.0.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package CakeExt.Git@3.0.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=CakeExt.Git&version=3.0.0
                    
Install as a Cake Addin
#tool nuget:?package=CakeExt.Git&version=3.0.0
                    
Install as a Cake Tool

cake-git-ext-plugin

GitHub license

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:

https://docs.github.com/en/packages/working-with-a-github-packages-registry/working-with-the-nuget-registry#installing-a-package

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 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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