I want to delete a branch locally and remote. My code:
using (var repository = new Repository(path))
{
var remote = repository.Network.Remotes[\"origin\
I just figured out the solution from the libgit2 sourcecode.
repository.Network.Push(origin, "+:/refs/heads/to-remove-branch")
The part +:/refs/heads/to-remove-branch
of the refspec specifies that the remove command is forced, else just use :/refs/heads/to-remove-branch
Source: https://github.com/libgit2/libgit2/blob/master/tests/online/push.c