Skip to main content

modelbit add_common_files ...

In git, common files in Modelbit are represented with symlinks. This CLI command provides a friendly API for creating symlinks when used within your Modelbit git repository.

tip

Be careful not to make symlinks within symlinked directories, or symlinks that point to other symlinks. That can have unexpected behavior.

Parameters

  • --deployment, -d: Optional. Specify the name of the deployment to receive symlinks to common files
  • --pattern, -p: Optional. Only link the files in /common matching the pattern. Can be the name of a file or directory in common and does not include the prefix common/.

Examples

To use modelbit add_common_files, clone your repository with modelbit clone and change into the repo's directory.

Add all common files to a deployment

From within the example_deployment's subdirectory:

cd deployments/example_deployment
modelbit add_common_files

From the root of the repository, using the --deployment or -d argument to specify example_deployment as the target deployment:

modelbit add_common_files --deployment example_deployment

Add only one file or directory from common/

Use the --pattern or -p argument to specify one file or directory to link from common/.

From within the example_deployment's subdirectory, add common/utils.py.

cd deployments/example_deployment
modelbit add_common_files --pattern utils.py

Or from the root of the repo for deployment example_deployment, add the common/lib directory:

modelbit add_common_files --deployment example_deployment --pattern lib

See also