Skip to main content

branch

codebolt.git.branch(path: string, branch: string): Promise<any>
Creates a new branch in the local repository at the given path.

Parameters

NameTypeDescription
pathstringThe file system path of the local Git repository.
branchstringThe name of the new branch to create.

Returns:

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

Status

Comming soon...

Example


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

Explaination

Creates a new branch in the local repository.It has two parameter.

path: A string specifying the local repository path.

branch: A string specifying the new branch name.