Cake.Git

Cake AddIn that extends Cake with Git aliases using LibGit2 and LibGit2Sharp.

#addin nuget:?package=Cake.Git&version=0.22.0

<package id="Cake.Git" version="0.22.0" />

dotnet add package Cake.Git --version 0.22.0

<PackageReference Include="Cake.Git" Version="0.22.0" />

Aliases

Class GitAliases. Contains functionality for working with GIT using LibGit2 & LibGit2Sharp

Add

Branch

Branches

GitBranchCurrent(ICakeContext, DirectoryPath) Gets the current branch.
GitBranches(ICakeContext, DirectoryPath) Gets a list of all branches from the repository.

Checkout

Clean

GitClean(ICakeContext, DirectoryPath) Remove untracked file(s) workspace.

Clone

GitClone(ICakeContext, string, DirectoryPath) Clone unauthenticated using default options.
GitClone(ICakeContext, string, DirectoryPath, GitCloneSettings) Clone unauthenticated using specific settings.
GitClone(ICakeContext, string, DirectoryPath, string, string) Clone authenticated using default options.
GitClone(ICakeContext, string, DirectoryPath, string, string, GitCloneSettings) Clone authenticated using specific settings.

Commit

Describe

Diff

GitDiff(ICakeContext, DirectoryPath) Get changed files from inital commit id up to current.
GitDiff(ICakeContext, DirectoryPath, string) Get changed files from certain commit id up to current.
GitDiff(ICakeContext, DirectoryPath, string, string) Get changed files from certain commit id up to current.

Init

GitInit(ICakeContext, DirectoryPath) Init using default options.

Log

Pull

GitPull(ICakeContext, DirectoryPath, string, string) Pull unauthenticated using default options.
GitPull(ICakeContext, DirectoryPath, string, string, string, string, string) Pull authenticating using default options.

Push

GitPush(ICakeContext, DirectoryPath) Push all branches unauthenticated.
GitPush(ICakeContext, DirectoryPath, string, string) Push all branches authenticated.
GitPush(ICakeContext, DirectoryPath, string, string, string) Push specific branch authenticated.
GitPushRef(ICakeContext, DirectoryPath, string, string) Push a tag to a remote unauthenticated.
GitPushRef(ICakeContext, DirectoryPath, string, string, string, string) Push a tag to a remote authenticated.

Remove

Repository

GitFindRootFromPath(ICakeContext, DirectoryPath) Finding git root path from subtree.
GitHasStagedChanges(ICakeContext, DirectoryPath) Checks if a repository contains staged changes.
GitHasUncommitedChanges(ICakeContext, DirectoryPath) Checks if a repository contains uncommited changes.
GitHasUntrackedFiles(ICakeContext, DirectoryPath) Checks if a repository contains untracked files.
GitIsValidRepository(ICakeContext, DirectoryPath) Checks if a specific directory is a valid Git repository.

Reset

GitReset(ICakeContext, DirectoryPath, GitResetMode) Resets the current branch head (HEAD) optionally modifying index and working tree to match.
GitReset(ICakeContext, DirectoryPath, GitResetMode, string) Sets the current branch head (HEAD) to a specified commit, optionally modifying index and working tree to match.

Tag

Tags

GitTag(ICakeContext, DirectoryPath, string) Applys tagName to repository.
GitTags(ICakeContext, DirectoryPath) Gets a list of all tags from the repo

Unstage

GitUnstage(ICakeContext, DirectoryPath, FilePath[]) Removes from the staging area all the modifications of a collection of file since the latest commit (addition, updation or removal).
GitUnstageAll(ICakeContext, DirectoryPath) Removes from the staging area all the modifications all files the latest commit (addition, updation or removal).