Click or drag to resize

RepositoryCreateBranchSpec Method (BranchSpec)

Create a new branch in the repository.

Namespace:  Perforce.P4
Assembly:  p4api.net (in p4api.net.dll) Version: 2023.2.258.5793
Syntax
public BranchSpec CreateBranchSpec(
	BranchSpec branch
)

Parameters

branch
Type: Perforce.P4BranchSpec
Branch specification for the new branch

Return Value

Type: BranchSpec
The Branch object if new branch was created, null if creation failed
Examples
To create a basic branch spec:
BranchSpec newBranchSpec = new BranchSpec();
newBranchSpec.Id = "newBranchSpec";
newBranchSpec.ViewMap = new ViewMap();
string v0 = "//depot/main/... //depot/rel1/...";
newBranchSpec.ViewMap.Add(v0);
_repository.CreateBranchSpec(newBranchSpec);
See Also