CLI Reference
/
checkout
Switch between component versions or remove local changes
$bit checkout <to> [component-pattern]
Copiedcopy
$bit U <to> [component-pattern]
Copiedcopy
Additional Notes
`bit checkout <version> [component-pattern]` => checkout the specified ids (or all components when --all is used) to the specified version `bit checkout head [component-pattern]` => checkout to the last snap/tag (use --latest if you only want semver tags), omit [component-pattern] to checkout head for all `bit checkout head~x [component-pattern]` => go backward x generations from the head and checkout to that version `bit checkout latest [component-pattern]` => checkout to the latest satisfying semver tag, omit [component-pattern] to checkout latest for all `bit checkout reset [component-pattern]` => remove local modifications from the specified ids (or all components when --all is used). also, if a component dir is deleted from the filesystem, it'll be restored when on a lane, "checkout head" only checks out components on this lane. to update main components, run "bit lane merge main"

Arguments

ArgumentDescriptionRequired
topermitted values: [head, latest, reset, {specific-version}, {head~x}]. 'head' - last snap/tag. 'latest' - semver latest tag. 'reset' - removes local changes
component-patterncomponent name, component id, or component pattern. use component pattern to select multiple components. wrap the pattern with quotes. use comma to separate patterns and "!" to exclude. e.g. "ui/**, !ui/button". use '$' prefix to filter by states/attributes, e.g. '$deprecated', '$modified' or '$env:teambit.react/react'. use `bit pattern --help` to understand patterns better and `bit pattern <pattern>` to validate the pattern.

Options

OptionOption AliasDescriptionValue Type
--interactive-merge-iwhen a component is modified and the merge process found conflicts, display options to resolve themboolean
--auto-merge-resolve-rin case of merge conflict, resolve according to the provided strategy: [ours, theirs, manual]string
--manual-same as "--auto-merge-resolve manual". in case of merge conflict, write the files with the conflict markersboolean
--all-aall componentsboolean
--workspace-only-eonly relevant for 'bit checkout head' when on a lane. don't import components from the remote lane that are not already in the workspaceboolean
--verbose-vshowing verbose output for inspectionboolean
--skip-dependency-installation-xdo not auto-install dependencies of the imported componentsboolean
--force-ours-do not merge, preserve local files as isboolean
--force-theirs-do not merge, just overwrite with incoming filesboolean