git.branch(branchName)

Checkout to provided branch.

If branch doesn’t exist - create new branch.

import { git } from '@codemod.com/workflow'

await git.clone('git@github.com:codemod-com/codemod.git')
    .branch('new-branch')

Parameters

branchName
string | BranchOptions
required
interface BranchOptions {
  branch: string;
  /**
   * @default true
   */
  force?: boolean;
}

Switch to provided branch. By default creates a branch if it doesn’t exist.

Returns