Collaborating between Bit components require setting up a remote server accessible for all collaborators. You may use bit.dev as a remote server or setup your own.
You can host and share components on your own server. I.e. export components to it and import components from the server. Building, testing and rendering should be done on your own CI/CD. Search and npm / yarn install are only available for components exported to bit.dev.
A Bit server is a host server that hosts one or more bare collections. That is, collections that do not have a working directory. Bit communication to server is done using SSH protocol. Collaborators will setup the server's collection as remotes to their local collections. Then, they export to and import from those collections.
- *nix server
- SSH installed on server
- Create a user for bit on your server and assign SSH key to it
- Install bit on your server
- Create Bit Bare collection:
su bit mkdir /opt/bit cd /opt/bit mkdir first-collection cd first-collection bit init --bare
- Add your own public SSH key to the authorized_keys list of the user bit. This will allow you to import and export components hosted in first-scope.
Working with Remote Collection
Setup the remote collection
To work with the remote collection do the following:
mkdir my-project cd my-project bit init bit remote add ssh://[email protected]:/opt/bit/first-collection
Export to remote collection
To export components to the remote collection:
bit export first-collection
Import from remote collection
to import components stored on the remote collection run:
bit import first-collection.component-name