Home > Back-end >  LibGit2Sharp Create a Pull Request by adding one or more reviewers option?
LibGit2Sharp Create a Pull Request by adding one or more reviewers option?

Time:10-06

I am using .NET 5.0 Using libgit2sharp 0.26.0, I've written code to create a new branch, change some files, push branch to bitbucket. Now I need to create a pull-request and add a reviewer to it. However, my Google searches don't turn up any relevant info. Does libgit2sharp support creating PRs by adding reviewer? I am using Commands.Pull(repo, signature, pullOptions)

CodePudding user response:

Libgit2sharp is a library to manage a local git repository. A pull request is more a notion of Git hosting websites (Github, Bitbucket,...) .

So you won't be able to create a PR with libgit2sharp.

Side note: the Pull method that you try to use is the equivalent of git pull to be able to fetch commits from a remote repository and integrate them with a merge.

If you want to create a PR from your program, you will have to use the bitbucket APIs or use a library that wraps them like https://github.com/lvermeulen/Bitbucket.Cloud.Net (not tested).

In all cases, you will need to manage the authentication (surely using a token generated from bitbucket website)

  • Related