Get branches
Retrieve all branches from a repository, including the current default branch.Parameters
The username or organization name that owns the repository
The repository name
Response
Returns an object containing the list of branches and the current default branch.Array of branch names in the repository
The name of the current default branch (typically
main or master)Example request
Example response
Usage notes
- The
currentBranchfield indicates the repository’s default branch that is checked out when the repository is cloned - Branch names are returned as an array of strings, ordered alphabetically
- This endpoint does not require authentication for public repositories
- For private repositories, you must be authenticated and have access to the repository