I am trying to remove a remote branch called test
. I don't get any errors while running this code but the remote branch is not getting removed.
'ans' is the destination including the branch id.
This code worked for me when I used the full branch. but I must have changed something because it doesnt work any more.
git.branchDelete().setBranchNames(ans).setForce(true).call();
RefSpec refSpec = new RefSpec()
.setSource(null)
.setDestination("refs/remotes/origin/test");
git.push().setRefSpecs(refSpec).setRemote("origin").call();