## zowe › endevor › synchronize › workspace

Synchronize a selected subset of remote Endevor inventory with a local Endevor workspace

#### Usage

zowe endevor synchronize workspace [workspace-dir] [options]

#### Positional Arguments

- `workspace-dir` (string)

  - The Endevor workspace directory, if different from current working directory.

#### endevor-location definition options

- `--environment` | `--env` (string)

  - The Endevor environment where your project resides.

- `--system` | `--sys` (string)

  - The Endevor system where your project resides.

- `--subsystem` | `--sub` (string)

  - The Endevor subsystem where your project resides.

- `--type` | `--typ` (string)

  - Name of the Endevor element's type.

- `--stage-number` | `--sn` (string)

  - The Endevor stage number where your project resides.

    Allowed values: \*, \%, 1, 2

- `--ccid` | `--cci` (string)

  - The CCID you want to use when performing an Element action.

- `--comment` | `--com` (string)

  - The comment you want to have when performing an Element action

- `--instance` | `-i` (string)

  - Specifies Endevor Web Services dataSource name.

#### options

- `--override-signout` | `--os` (boolean)

  - Specify if you want to override the Signout of any Endevor elements affected by this action.

- `--signout` (boolean)

  - Specify if you want to perform the action with signing out any retrieved elements.

#### workspace options

- `--element` | `--ele` | `--elem` (string)

  - Name filter to synchronize only specific Endevor element(s).

    Default value: *

- `--dry-run` | `--dr` (boolean)

  - List all actions the synchronization would perform, without executing them.

- `--reset` | `--rst` (boolean)

  - Revert any local changes, resetting the local workspace to match the current state of the remote Endevor inventory.

- `--limit` | `--lim` (number)

  - If the synchronization would need to perform more than 'limit' Endevor actions, do not perform the actions now, only report them. 0 means no limit.

    Default value: 0

- `--one-way` (boolean)

  - Do not update Endevor elements with local changes, only retrieve remote changes from Endevor and resolve any conflicts.

- `--allow-deletes` | `--del` (boolean)

  - Allow workspace synchronization to delete unchanged Endevor elements when it detects the corresponding local files have been deleted. Default is off to maintain backward compatibility.

- `--file-extension` | `--ext` (string)

  - The strategy for deciding what file extension to use during a bulk retrieve or workspace synchronization. Must be one of the following:

          none: File name is equal to element name, no extension is added.

          file\-ext: The file extension defined in the Type definition is used; If not defined, no extension is added.

          type\-name: The type name is used as the file extension.

          mixed: The file extension defined in Type definition is used; If not defined, the type name is used instead.

    Default value: mixed
    Allowed values: none, file-ext, type-name, mixed

#### endevor session definition options

- `--host` | `--hostname` (string)

  - Specifies the base host name.

- `--port` | `-p` (string)

  - Specifies the port number.

- `--protocol` | `--prot` (string)

  - Specifies the protocol used for connecting to Endevor Rest API

    Default value: https
    Allowed values: http, https

- `--user` | `--username` (string)

  - Specifies the user name.

- `--password` | `--pass` (string)

  - Specifies the user's password.

- `--reject-unauthorized` | `--ru` (boolean)

  - Specify this option to have the server certificate verified against the list of supplied CAs

- `--base-path` | `--bp` (string)

  - Specifies the base path used for connecting to Endevor Rest API

#### Profile Options

- `--endevor-profile` | `--endevor-p` (string)

  - The name of a (endevor) profile to load for this command execution.

- `--endevor-location-profile` | `--endevor-location-p` (string)

  - The name of a (endevor-location) profile to load for this command execution.

- `--base-profile` | `--base-p` (string)

  - The name of a (base) profile to load for this command execution.

#### Base Connection Options

- `--token-type` | `--tt` (string)

  - The type of token to get and use for the API. Omit this option to use the default token type, which is provided by 'zowe auth login'.

- `--token-value` | `--tv` (string)

  - The value of the token to pass to the API.

- `--cert-file` (local file path)

  - The file path to a certificate file to use for authentication.

    Note: The CLI does not support certificate files that require a password. For more information, search Troubleshooting PEM Certificates in Zowe Docs.

- `--cert-key-file` (local file path)

  - The file path to a certificate key file to use for authentication

#### Examples

- Synchronize all elements in the map location defined by the currently active endevor-location profile with current directory:

  - `zowe endevor synchronize workspace`

- Synchronize all elements in the map location defined by the currently active endevor-location profile with workspace directory 'C:/projects/myWorkspace':

  - `zowe endevor synchronize workspace 'C:/projects/myWorkspace'`

- Synchronize all elements in system SYSTEM1 subsystem SUBSYS1 from environment DEV stage 1, whose type begins with 'ASM', with current directory:

  - `zowe endevor synchronize workspace --environment DEV --stage_number 1 --system SYSTEM1 --subsystem SUBSYS1 --type ASM* --ccid myccid --comment 'my changes'`

- Synchronize all elements in the map location defined by the currently active endevor-location profile, whose name is 'PRFX' followed by any 2 characters and ending with '11', with workspace directory 'C:/projects/myWorkspace':

  - `zowe endevor synchronize workspace 'C:/projects/myWorkspace' --ccid myccid --comment 'my changes' --element PRFX%%11`

- Display all actions needed to synchronize all elements in the map location defined by endevor-location profile 'mysandbox' with current directory, without performing them:

  - `zowe endevor synchronize workspace --dry-run --endevor-location-profile mysandbox`

- Revert all local changes in the map location defined by the currently active endevor-location profile, resetting your workspace to match Endevor:

  - `zowe endevor synchronize workspace --reset`