How to list all branches in GitHub using REST API?

Step 1: Create a personal access token on GitHub.

Step 2: List all branches in GitHub using REST API.