Showing results for 
Search instead for 
Did you mean: 
Ground Controller Lvl 1
Message 1 of 2

GitHub API to create a branch



Could you please let me know if there is Github API to create a branch for any given repo? If you could find then, could you please help me with the link?



Jalees Ahmed Shaik

1 Reply
Community Manager
Message 2 of 2

Re: GitHub API to create a branch

Hi @jalees


Thank you for being here! In order to create a branch via API, you would have to use the Git Refs API. Creating a new reference takes two parameters. For a branch, the ref should look like refs/heads/[NEW-BRANCH-NAME] and sha should point to a hash from which to branch off.


I hope this helps!

Thanks for being here, sharing, and keeping our community awesome!

Mark helpful posts with Accept as Solution to help other users locate important info. Don't forget to give Kudos for great content!