Understanding the sws create Command

This command creates a workspace for a semiconductor logical item revision. Objects in the workspace can be edited locally.

See Also
In Other Guides
Understanding User Groups and Permissions

This command creates a local design workspace root in the specified directory. If the specified directory does not exist, the command creates the directory. This workspace stores local copies of objects stored in a semiconductor repository connected to a semiconductor logical item. From this workspace, you perform a variety of operations including updating the workspace, adding relationships between semiconductor logical items, and adding, updating, and deleting objects associated with item.

For the files to be fetched from the repository, the user must be either the owner of the repository or a member of a user group assigned to one of the repository’s access levels. The sws create command does not run in an atomic fashion. It processes through a sequence of steps and either completes successfully or terminates with an explanatory error message if there is an issue.

If the item is connected to a GIT repository, the create operation runs a git clone command to fetch the files into the new item workspace, create remote-tracking branches for each branch in the repository, and create and check out the initial branch.

If the item is connected to a DesignSync module, the create operation uses your top-level item workspace as the DesignSync module root folder.

Important: You cannot designate a DesignSync module root folder above the folder containing the top-level item folder.
Note: Semiconductor Item Management does not support hierarchical references in DesignSync.

The sws create command cannot be run on an existing workspace. If the create command fails during the creation flow, you can run sws create again to complete workspace creation. If it fails after creating the workspace directory, during the checkout phase, you should run sws update to bring in the files.

Note: If you are adding an item to an existing workspace, do not use sws create, follow the procedure for Inserting a Relationship between Two Items to fetch the item, then use the connect commands to create the relationship.

If any unmanaged files or folders in a directory clash with files that would be fetched from the repository, the command fails and the workspace is created, but the files will not be placed in the workspace. The error includes a list of the collided files and folders. Resolve the issues by removing the local files or folders that caused the conflict. Then you can run the sws update command to fetch the files into the workspace.

Note: If an unmanaged file is identical to a managed file being checked out from the semiconductor logical item, the files are not considered in conflict, and the workspace create does not return an error. The file becomes a managed file in the workspace.

When --verbose is not specified, the command returns a success message including the number of files placed in the workspace. When --verbose is specified, the output also includes the amount of data transferred, the commit ID of the latest commit on the branch, the absolute path to the newly created workspace, and information about the item revision and repository branch associated with the workspace.

Note: The output of the command for items connected to external code management systems includes all the information returned from the code management system.

If you are using an external SCM system, such as Git, DesignSync, or Subversion, you must save credentials for the external repository before connecting to the repository. Consult the documentation for your external SCM system for the command to save your SCM credentials.