Skip to main content

refs

Overview

Namerefs
TypeResource
Idgithub.git.refs

Fields

NameDatatype
urlstring
node_idstring
objectobject
refstring

Methods

NameAccessible byRequired ParamsDescription
list_matching_refsSELECTowner, ref, repoReturns an array of references from your Git database that match the supplied name. The :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.

When you use this endpoint without providing a :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.

Note: You need to explicitly request a pull request to trigger a test merge commit, which checks the mergeability of pull requests. For more information, see "Checking mergeability of pull requests".

If you request matching references for a branch named 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.
create_refINSERTowner, repo, data__ref, data__shaCreates a reference for your repository. You are unable to create new references for empty repositories, even if the commit SHA-1 hash used exists. Empty repositories are repositories without branches.
delete_refDELETEowner, ref, repo
update_refEXECowner, ref, repo, data__sha