Skip to content

Latest commit

 

History

History
143 lines (97 loc) · 3.7 KB

API.md

File metadata and controls

143 lines (97 loc) · 3.7 KB

GitClient

Git Client Class

Kind: global class
Access: public

new GitClient(dir, credentials)

create a git client with root dir and credential info

Param Type Description
dir String
credentials Object optional

gitClient.init()

init a git repo

Kind: instance method of GitClient

gitClient.clone(url, branchName)

clone a git repo

Kind: instance method of GitClient

Param Type
url String
branchName String

gitClient.pull()

get commits from remote and merge with local changes

Kind: instance method of GitClient

gitClient.fetch(remoteName)

fetch commits

Kind: instance method of GitClient

Param Type
remoteName String

gitClient.fetchAll()

fetch commits from all remotes

Kind: instance method of GitClient

gitClient.push()

push commits to remote

Kind: instance method of GitClient

gitClient.add(pathspec)

add files to index

Kind: instance method of GitClient

Param Type Description
pathspec String | Array - Array: file path list - String: file path or glob rule

gitClient.reset(pathspec)

reset files from index to last commit

Kind: instance method of GitClient

Param Type Description
pathspec String | Array - Array: file path list - String: file path or glob rule

gitClient.remove(pathspec)

remove files from index

Kind: instance method of GitClient

Param Type Description
pathspec String | Array - Array: file path list - String: file path or glob rule

gitClient.commit(message, options)

commit a message

Kind: instance method of GitClient

Param Type
message String
options Object

gitClient.getStatus(untracted) ⇒ Array

get status of index and work directory

Kind: instance method of GitClient

Param Type
untracted Boolean

gitClient.getBranches() ⇒ Array

get branches info

Kind: instance method of GitClient