Search code examples
githubgithub-apioctokit.net

How to reset a remote GitHub branch via GitHub API or Octokit?


I am having a specific situation, when I need to programmatically hard-reset a GitHub branch (basically, delete all commits in the branch). I can only use Octokit, or GitHub API, not git cli. But I can't see corresponding endpoints in API or methods in Octokit to reset remote branches. Is it even possible?

Thanks.


Solution

  • No, not possible from github rest api.