:ref
in the URL must be formatted as heads/<branch name>
for branches and tags/<tag name>
for tags. If the :ref
doesn't exist in the repository, but existing refs start with :ref
, they will be returned as an array.:ref
, it will return an array of all the references from your Git database, including notes and stashes if they exist on the server. Anything in the namespace is returned, not just heads
and tags
.feature
but the branch feature
doesn't exist, the response can still include other matching head refs that start with the word feature
, such as featureA
and featureB
.curl --location --request GET 'https://api.github.com/repos///git/matching-refs/'
[
{
"node_id": "string",
"object": {
"sha": "7638417db6d59f3c431d3e1f261cc637155684cd",
"type": "string",
"url": "http://example.com"
},
"ref": "string",
"url": "http://example.com"
}
]