Checkout

Switch version for components, or restore working component files.

Synopsis

bit checkout|c [-i|--interactive-merge] [-o|--ours] [-t|--theirs] [-m|--manual] [-v|--verbose] [--skip-npm-install] [--ignore-dist] [--skip-updates] [-h|--help] [-r|--reset] [-a|--all] <version> <component id> <latest>

Examples

Switch between component versions in your working tree

In case a sourced component has a newer version then the one you use in your project, and you want to test it locally before you decide to update.

$ bit import foo/bar # this will fetch all objects of the component, including newer versions
$ bit checkout 0.0.3 foo/bar # to replace the working tree of the component

Switch between versions of multiple components in your working tree

You can list a number of components together in order to use the same version for all of them.

bit checkout 0.0.3 foo/bar sun/moon

Checkout the latest version of a component

As a quick way to checkout the latest version of a component to the workspace, add the latest argument.

$ bit checkout latest foo/bar

Checkout the latest version of all components

Use the --all to checkout all components in their latest version.

$ bit checkout latest --all

Remove local modifications of a component

Revert all changes to foo/bar the version 1.0.0

$ bit checkout 1.0.0 foo/bar --reset

Options

-i, —interactive-merge

Prompt interactive steps to resolve all conflicts.

bit checkout --interactive-merge <component_id>

-o, —ours

Triggers the merge command to resolve the conflict with the --ours flag.

bit checkout --ours <component_id>

-t, —theirs

Triggers the merge command to resolve the conflict with the --their flag.

bit checkout --theirs <component_id>

-m, —manual

Triggers the merge command to resolve the conflict with the --manual flag.

bit checkout --manual <component_id>

—skip-npm-install

Do not install package dependencies of a component when doing a checkout.

bit checkout --skip-npm-install <component_id>

—ignore-dist

Ignore distribution files of a component when doing a checkout.

bit checkout --ignore-dist <component_id>

-a, —all

Checkout all components

bit checkout latest --all