Click or drag to resize

RepositoryDeleteBranchSpec Method

Delete a branch from the repository

Namespace:  Perforce.P4
Assembly:  p4api.net (in p4api.net.dll) Version: 2023.2.258.5793
Syntax
public void DeleteBranchSpec(
	BranchSpec branch,
	Options options
)

Parameters

branch
Type: Perforce.P4BranchSpec
The branch to be deleted
options
Type: Perforce.P4Options
The '-f' and '-d' flags are valid when deleting an existing branch
Examples
To delete a branch spec owned by you [-d implied]:
BranchSpec deleteBranchSpec = new BranchSpec();
deleteBranchSpec.Id = "newBranchSpec";
_repository.DeleteBranchSpec(deleteBranchSpec, null);
To delete a branch owned by someone other than you [-d implied] [-f requires admin privileges]:
BranchSpec deleteBranchSpec = new BranchSpec();
deleteBranchSpec.Id = "newBranchSpec";
Options opts = new Options(BranchSpecsCmdFlags.Force);
_repository.DeleteBranchSpec(deleteBranchSpec, opts);
See Also