Interface CheckoutBranch

Options for checking out branches.

interface CheckoutBranch {
    branch: string;
    force?: boolean;
    merge?: boolean;
    newBranch?: string;
}

Properties

branch: string

Branch to checkout; if it refers to a branch, then that branch is checked out. Otherwise, if it refers to a valid commit, your HEAD becomes "detached" and you are no longer on any branch.

force?: boolean

When switching branches, proceed even if the index or the working tree differs from HEAD. This is used to throw away local changes.

merge?: boolean

When switching branches, if you have local modifications to one or more files that are different between the current branch and the branch to which you are switching, the command refuses to switch branches in order to preserve your modifications in context. However, with this option, a three-way merge between the current branch, your working tree contents, and the new branch is done, and you will be on the new branch.

newBranch?: string

The name for the new local branch.