Switch between component versions or remove local changes
$bit checkout <to> [component-pattern]
$bit U <to> [component-pattern]
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
Argument | Description | Required |
---|---|---|
to | permitted values: [head, latest, reset, specific-version]. 'head' - last snap/tag. 'latest' - semver latest tag. 'reset' - removes local changes | ✅ |
component-pattern | component 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
Option | Option Alias | Description | Value Type |
---|---|---|---|
--interactive-merge | -i | when a component is modified and the merge process found conflicts, display options to resolve them | boolean |
--auto-merge-resolve | - | in case of merge conflict, resolve according to the provided strategy: [ours, theirs, manual] | string |
--all | -a | all components | boolean |
--workspace-only | -e | only relevant for 'bit checkout head' when on a lane. don't import components from the remote lane that are not already in the workspace | boolean |
--verbose | -v | showing verbose output for inspection | boolean |
--skip-dependency-installation | -x | do not auto-install dependencies of the imported components | boolean |
--force-ours | - | regardless of conflicts, ignore theirs changes and keep our local files intact | boolean |
--force-theirs | - | regardless of conflicts, ignore our local changes and use theirs files | boolean |