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 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) 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' - 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 `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-in case of merge conflict, resolve according to the provided strategy: [ours, theirs, manual]string
--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-regardless of conflicts, ignore theirs changes and keep our local files intactboolean
--force-theirs-regardless of conflicts, ignore our local changes and use theirs filesboolean