The following workflows demonstrate how to remove components from a lane, in different states of the lane/components.
When merging a lane with removed components into another lane (or 'main), the removed components from the source lane will not be removed from the target lane.
Note that commands are demonstrated on a single component but can be applied to multiple components, as well.
For example, the following command uses a glob pattern to remove all components from the my-org.my-scope
scope that have the ui
namespace:
The following workflow demonstrates how to remove a component in the following cases:
- When the component to be removed has never been snapped on a lane (the component status is either 'new' or 'modified')
- When the component to be removed has been snapped on a lane, but the lane has never been exported
If the component to be removed has been snapped on a lane and the lane has been exported, follow this workflow.
To remove a component, run the following:
The output should confirm that the component has been removed from the workspace:
my-component
caution
A component removed in the aforementioned scenarios, cannot be recovered!
Run the following to remove a component that has been snapped on a lane that has already been exported:
The output should confirm that the component has been marked as removed
:
my-org.my-scope/my-component@a1f1902f7317f7281f658db92407eb9a8bc73cc2
to update the remote, please snap and then export. to revert, please use "bit recover"
Run the following to snap the changes (the component is now set as 'removed'):
The output should confirm that the component has been snapped:
changed components
(components that got a version bump)
> my-org.my-scope/my-component@be78062a110da99cc417d8248091e3b37edb7a03
Run the following to export the changes:
The output should confirm that the component has been removed from the remote lane:
Run
bit recover COMPONENT_ID
to undo the removal of the component from the remote lane.
To remove a component only from a workspace, without affecting the lane, run the following:
The output should confirm that the component has been removed from the workspace:
my-component
This option is useful when a component from a lane is no longer maintained (no longer requires updates), but should nevertheless remain in the lane.
To restore a component that was removed from the workspace, check it out from the lane and into your workspace.