Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Git

Hierarchy

  • Git

Index

Constructors

constructor

  • new Git(cloneDirectory?: string, keyFile?: string): Git
  • Parameters

    • Default value cloneDirectory: string = process.cwd()
    • Default value keyFile: string = env.keyFile()

    Returns Git

Properties

cloneDirectory

cloneDirectory: string

keyFile

keyFile: string

Optional url

url: undefined | string

Methods

add

  • add(...params: string[]): Promise<any>

areFilesChanged

  • areFilesChanged(): Promise<boolean>

assert

  • assert(url: string): Promise<void>
  • Ensures that a repository is initialized and matches the provided url

    Parameters

    • url: string

    Returns Promise<void>

checkout

  • checkout(version: string): Promise<ChildProcess>

clone

  • clone(url: string): Promise<void>

commit

  • commit(message: string): Promise<any>

createOrphan

  • createOrphan(branch: string): Promise<void>

ensureConfig

  • ensureConfig(user?: string, email?: string): Promise<void>
  • Ensures configuration required by GitHub exists

    Parameters

    • Default value user: string = "Travis CI"

      a fallback user name if one does not exist

    • Default value email: string = "support@sitepen.com"

      a fallback email if one does not exist

    Returns Promise<void>

execSSHAgent

  • execSSHAgent(command: string, args: string[], options?: any): Promise<ChildProcess>
  • Execute a credentialed git command

    Parameters

    • command: string
    • args: string[]
    • Default value options: any = {}

    Returns Promise<ChildProcess>

getConfig

  • getConfig(key: string): Promise<string>

hasConfig

  • hasConfig(key: string): Promise<boolean>

hasDeployCredentials

  • hasDeployCredentials(): boolean

headRevision

  • headRevision(): Promise<string>

isInitialized

  • isInitialized(): boolean
  • If the current cloneDirectory is a git repository

    Returns boolean

pull

  • pull(remote?: undefined | string, branch?: undefined | string): Promise<ChildProcess>
  • Parameters

    • Optional remote: undefined | string
    • Optional branch: undefined | string

    Returns Promise<ChildProcess>

push

  • push(branch?: undefined | string, remote?: string): Promise<ChildProcess>
  • Parameters

    • Optional branch: undefined | string
    • Default value remote: string = "origin"

    Returns Promise<ChildProcess>

setConfig

  • setConfig(key: string, value: string): Promise<ChildProcess>
  • Parameters

    • key: string
    • value: string

    Returns Promise<ChildProcess>

Generated using TypeDoc