Skip to main content

checkout

codebolt.git.checkout(path: string, branch: string): Promise<any>
Checks out a branch or commit in the local repository at the given path.

Parameters

NameTypeDescription
pathstringThe file system path of the local Git repository.
branchstringThe name of the branch or commit to check out.

Returns:

 Promise<any>
A promise that resolves with the response from the checkout event.

Status

Working Progress...

Example


await git.checkout('/path/to/repo', 'feature-branch')

Explaination

Check out a specific branch in the local repository. It has two parameter.

path: A string specifying the local repository path.

branch: A string specifying the branch name to be checked out.