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 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
Argument | Description | Required |
---|---|---|
to | permitted values: [head, latest, reset, {specific-version}, {head~x}]. '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 '$' 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
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 | -r | in 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 markers | boolean |
--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 | - | do not merge, preserve local files as is | boolean |
--force-theirs | - | do not merge, just overwrite with incoming files | boolean |