# Managing branch specifications

In Perforce, a codeline is a set of related files — for example, all the source code required to build your software product. Copying an edit from one file set to the other is called integration. Copying a set of files is called making a branch or branching. Branching is performed using the Integrate feature. You can perform simple branches using a file specification.

To ensure that complex branching is done in a controlled manner (for example, to prevent typographical errors when entering target directories or to make sure that complicated branches are performed correctly), you can create a branch specification, which specifies the relationship between two codelines. When you branch, you can use the branch specification instead of a file specification. Branch specifications are displayed in the right pane on the Branches tab.

To change a branch specification, double-click it and enter your changes in the Branch form. Modify the View field to reflect the relationship between source and target codelines. For example, to create release 2 of Jam from the code in your main codeline, you might use the following view:

> `//depot/jam_proj/... //depot/jam_r2.0/...`

To create a branch specification, choose File>New>Branchspec... and enter the required information. To prevent the specification from being changed by other users, check locked. To confine integration to closely related files, choose direct; to enable integration between distantly related files, choose indirect.

To delete a branch specification, click the specification you want to delete, then select Edit>Delete Branch branchname.

To integrate using a branch specification:

1. Right click the files you want to integrate and choose Integrate... The Integrate dialog is displayed.
2. Click the Branch Specification tab.
3. Brows for the branch specification you want to use. Select the branch specification and click OK.
4. In the Target field, specify where you want the source files integrated. The target must be a path that contains some or all of the paths identified in the branch specification. In other words, the target can be a subset of the path specified by the branch specification.
5. Specify other options as desired:

- Do not copy target files to workspace: by default, newly branched files are copied to the workspace. To prevent the files from being copied, check this option.
- Enable baseless merges: to perform the integration even if a target file does not share a common ancestor with a source file, check this box.
- Disregard previous integration history:Force the integration on all revisions of source and target files, even if some revisions have been integrated in the past. Best used with a revision range.
- Propogate source filetypes to target files: assign the source file's filetype to the target file. If this is not selected, the target file retain its filetype.
- Reverse mappings in branch view: swap source and target specifications when performing this integration.
- Enable integrations around deleted revisions:allow an integration that opens the target file for delete when the source file has been deleted, and allow an integration that branches a new target files that was previously deleted.
- Do not sync target files to head revisions: Don't automatically get the latest revision of target files before integrating. Use the current workspace revision instead.

6. Pending Changelist: to perform the integration using a changelist other than the default changelist, choose the desired changelist from this drop-down list.
7. To preview the results of the operation, click Preview. To integrate the files using the selected branch specification, click Integrate.