mkbranch
A branch is a separate line of development that uses existing repositories and the files in them as a starting point. When a repository is branched, the files in both branches are initially identical. As file contents change, the branched files become dissimilar. When you branch a repository, changes can be promoted to or rebased from associated branches. Create a branch when you need to make changes to source files without affecting existing files. Surround SCM includes the following branch types:
- A baseline branch is a public branch. Allowing check outs on a baseline lets all users check out and make changes to the baseline code.
- A workspace branch is a private branch that is used to track and isolate changes made by users. Users create workspace branches. The branch a workspace is created from is its parent branch. When a user finishes making changes, changes are promoted from the workspace to the baseline branch. Changes can also be rebased from the baseline to a workspace branch.
- A snapshot branch is a static branch that generally corresponds to a project milestone, such as a QA build or final release build. Most Surround SCM commands are disabled in snapshots. You cannot check out, check in, or merge files into a snapshot branch. Create a snapshot branch when you need to be able to tell exactly which versions of files went into a build. You can create a snapshot branch based on the latest file version or a specific label or timestamp.
To create a mainline branch, see mkmainline.
sscm mkbranch Branch Repo1:[Repo2:...] [-xbBranchName|-xrRepo3[:Repo4:...]] [-bParentBranch] [-ccComment|-cpCommentPath|-c-] [-fdefault|-fcopyparent] [-h] [-lLabel] [-sworkspace|-sbaseline|-ssnapshot] [-tTimeStamp] [-i] [-aStateID] [-y[Username:Password|+|=]] [-zSCMServerAddr:PortNum|zPath] [+u]
Option | Description |
---|---|
Branch | New branch name. |
Repo | Full path to the included repository, including parent repositories. If specifying more than one parent repository, separate each repository path with a colon. Cannot use multiple repositories with -xb. |
-a | StateID to search for. Only latest file version in this state is retrieved. Use lsstate to find StateID. Cannot use with -l or -t. |
-b | Parent branch to create child branch from. If not specified, mainline branch is used. |
-c | Enter a comment or the comment text file path. Enter -cc to prompt for comment, -cp to prompt for the comment file path, or -c- if a comment is not needed. CommentPath can be full path of a local text file, partial path if file is in a subdirectory of current directory, or file name if file is in current directory. |
-f | Set custom field values in new branch. If an option is not specified, new branch uses default custom field values. Custom field values are always copied from parent branch when snapshot branches are created. -fdefault: Set default custom field values on all files -fcopyparent: Copy custom field values from parent branch |
-h | Display online help for the command. |
-i | Do not include removed files in the new branch. Must be used with -a, -l, or -t. If -a, -l, or -t is specified and -i is not, removed files matching -a, -l, or -t will be copied. |
-l | Label to search for. Files in parent branch with this label are copied to new child branch. Cannot use with -a or -t. If -l, -a, or -t are not specified, the newest file versions are copied and the removed files will not be copied. |
-s | Branch type: workspace, baseline, or snapshot. If a type is not specified, a workspace branch is created. |
-t | Local timestamp to search for. Format: yyyymmddhh:mm:ss. Files with this timestamp are copied to new branch. Cannot use with -a or -l. If -t, -a, or -l are not specified, the newest file versions are copied and the removed files will not be copied. |
-x | Exclude specified repositories from the new branch. Use -xbBranchName to include and exclude the same repositories as another branch. Use -xrRepo3[:Repo4:...] to exclude specified repositories. |
-y | Enter a Surround SCM username and password if you do not want to use the default value. To use single sign-on, enter -y+. If you use an identity provider to authenticate, the provider web page opens if you have not yet authenticated. Authenticate with the provider and then return to the CLI. |
-z | Enter the Surround SCM Server host computer address and port number if you do not want to use the default value. IPv6 addresses must be in square brackets. If you received a server settings file from your Surround SCM administrator, enter the path to the XML file instead of entering the server connection information. |
+u | Display output in Unicode (Windows only). Output cannot be sent to a file. If output is enabled for all commands, enter +u- to disable it for this command. |