public GitBranchResponse deleteBranch ( File repositoryPath , boolean forceDelete , boolean remote , Ref branchName ) throws IOException , JavaGitException { CheckUtilities . checkNullArgument ( repositoryPath , "repository path" ) ; CheckUtilities . checkNullArgument ( branchName , "branch name" ) ; CheckUtilities . validateArgumentRefType ( branchName , Ref . RefType . BRANCH , "branch name" ) ; IClient client = ClientManager . getInstance ( ) . getPreferredClient ( ) ; IGitBranch gitBranch = client . getGitBranchInstance ( ) ; return gitBranch . deleteBranch ( repositoryPath , forceDelete , remote , branchName ) ; }
This method deletes the specified branch using the - d command line option .