I am trying to create a new branch, update a file in that branch, and then create a PR all using the Git API.
To create a branch, I understand that we need to use the Reference API for this, as mentioned in the post - Github API - create branch?
So I create it using the following POST call -
/repos/:user/:repo/git/refs
with 2 body parameters -
ref - new branch name (refs/heads/{new branch})
sha - sha1 value of the master branch.
I get a success code. However, when I use the branches API to get a list of all branches, I dont see my newly created one! The API to get branches is -
repos/:user/:repo/branches
What am I missing here?