Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/kd_clients/mod.ts>GitClient

Various HTTP clients for miscellaneous use.
Latest
class GitClient
extends GraphQlClient
import { GitClient } from "https://deno.land/x/kd_clients@v1.0.0-preview.14/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.

getAllBranches(): Promise<GitBranchModel[]>

Gets all branches for the repository.

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.