Skip to main content
Module

x/kd_clients/mod.ts>GitClient

Various types of HTTP clients for miscellaneous use.
Go to Latest
class GitClient
extends GraphQlClient
import { GitClient } from "https://deno.land/x/kd_clients@v1.0.0-preview.4/mod.ts";

Provides a client for to perform git operations for a GitHub repository.

Constructors

new
GitClient(
ownerName: string,
repoName: string,
token: string,
)

Initializes a new instance of the GitClient class.

Properties

private
readonly
isInitialized: boolean
private
readonly
repoClient: RepoClient
writeonly
ownerName: string

Sets the name of the owner of the repository.

writeonly
repoName: string

Sets the name of the repository.

Methods

addCommit(branchName: string, commitMessage: string): Promise<void>

Adds a commit with the given commitMessage to a branch with the given branchName.

branchExists(name: string): Promise<boolean>

Gets a value indicating whether or not a branch with the given branch name exists.

createBranch(newBranchName: string, branchFromName: string): Promise<GitBranchModel>

Creates a branch with the given newBranchName from a branch that matches the given branchFromName.

getBranch(name: string): Promise<GitBranchModel>

Gets a branch with the given branch name.

getBranches(untilPredicate?: (branch: GitBranchModel) => boolean): Promise<GitBranchModel[]>

Gets a list of branches for a repository.