How do I get the default branch?
If you only wish to lookup the default branch on a project’s repository, the
Get single project API call carries a
default_branch field in its response:
~> curl -s 'https://gitlab.example.com/api/v4/projects/:ID' | jq -r '.default_branch'
/branches from the API to get my branches
Not all of my branches come back
How do I get all of the branches?
List repository branches API, like other collection-returning API calls, uses pagination and limits each response to a number of maximum items. Follow the pagination instructions to retrieve the full set of results iteratively.