Git - GitHub Docs
Skip to main content Skip to content Collapse sidebar Expand sidebar Git Reference documentation for GraphQL schema types in the Git category. In this article Mutations createRef Mutation Create a new Git Ref. Input fields for createRef input ( CreateRefInput! ) Return fields for createRef Name Description clientMutationId ( String ) A unique identifier for the client performing the mutation. ref ( Ref ) The newly created ref. deleteRef Mutation Delete a Git Ref.
Input fields for deleteRef input ( DeleteRefInput! ) Return fields for deleteRef Name Description clientMutationId ( String ) A unique identifier for the client performing the mutation. updateRef Mutation Update a Git Ref. Input fields for updateRef input ( UpdateRefInput! ) Return fields for updateRef Name Description clientMutationId ( String ) A unique identifier for the client performing the mutation. ref ( Ref ) The updated Ref. updateRefs Mutation Creates, updates and/or deletes multiple refs in a repository.
This mutation takes a list of RefUpdate s and performs these updates on the repository. All updates are performed atomically, meaning that if one of them is rejected, no other ref will be modified. RefUpdate.beforeOid specifies that the given reference needs to point to the given value before performing any updates. A value of 0000000000000000000000000000000000000000 can be used to verify that the references should not exist.
RefUpdate.afterOid specifies the value that the given reference will point to after performing all updates. A value of 0000000000000000000000000000000000000000 can be used to delete a reference. If RefUpdate.force is set to true , a non-fast-forward updates for the given reference will be allowed. Input fields for updateRefs input ( UpdateRefsInput! ) Return fields for updateRefs Name Description clientMutationId ( String ) A unique identifier for the client performing the mutation.
Objects Blame Object Represents a Git blame. Fields for Blame Name Description ranges ( [BlameRange!]! ) The list of ranges from a Git blame. BlameRange Object Represents a range of information from a Git blame. Fields for BlameRange Name Description age ( Int! ) Identifies the recency of the change, from 1 (new) to 10 (old). This is calculated as a 2-quantile and determines the length of distance between the median age of all the changes in the file and the recency of the current range's change. commit ( Commit! ) Identifies the line author. endingLine ( Int! ) The ending line for the range. startingLine ( Int! ) The starting line for the range.
Blob Object Represents a Git blob. Blob Implements GitObject Node Fields for Blob Name Description abbreviatedOid ( String! ) An abbreviated version of the Git object ID. byteSize ( Int! ) Byte size of Blob object. commitResourcePath ( URI! ) The HTTP path for this Git object. commitUrl ( URI! ) The HTTP URL for this Git object. id ( ID! ) The Node ID of the Blob object. isBinary ( Boolean ) Indicates whether the Blob is binary or text.
Returns null if unable to determine the encoding. isTruncated ( Boolean! ) Indicates whether the contents is truncated. oid ( GitObjectID! ) The Git object ID. repository ( Repository! ) The Repository the Git object belongs to. text ( String ) UTF8 text data or null if the Blob is binary. GitActor Object Represents an actor in a Git commit (ie. an author or committer). Fields for GitActor Name Description avatarUrl ( URI! ) A URL pointing to the author's public avatar.
Arguments for avatarUrl size ( Int ) The size of the resulting square image. date ( GitTimestamp ) The timestamp of the Git action (authoring or committing). email ( String ) The email in the Git commit. name ( String ) The name in the Git commit. user ( User ) The GitHub user corresponding to the email field. Null if no such user exists. GitActorConnection Object The connection type for GitActor. Fields for GitActorConnection Name Description edges ( [GitActorEdge] ) A list of edges. nodes ( [GitActor] ) A list of nodes. pageInfo ( PageInfo! ) Information to aid in pagination. totalCount ( Int! ) Identifies the total count of items in the connection.
GitActorEdge Object An edge in a connection. Fields for GitActorEdge Name Description cursor ( String! ) A cursor for use in pagination. node ( GitActor ) The item at the end of the edge. GpgSignature Object Represents a GPG signature on a Commit or Tag. GpgSignature Implements GitSignature Fields for GpgSignature Name Description email ( String! ) Email used to sign this object. isValid ( Boolean! ) True if the signature is valid and verified by GitHub. keyId ( String ) Hex-encoded ID of the key that signed this object. payload ( String! ) Payload for GPG signing object.
Raw ODB object without the signature header. signature ( String! ) ASCII-armored signature header from object. signer ( User ) GitHub user corresponding to the email signing this commit. state ( GitSignatureState! ) The state of this signature. VALID if signature is valid and verified by GitHub, otherwise represents reason why signature is considered invalid. verifiedAt ( DateTime ) The date the signature was verified, if valid. wasSignedByGitHub ( Boolean! ) True if the signature was made with GitHub's signing key.
Push Object A Git push. Push Implements Node Fields for Push Name Description id ( ID! ) The Node ID of the Push object. nextSha ( GitObjectID ) The SHA after the push. permalink ( URI! ) The permalink for this push. previousSha ( GitObjectID ) The SHA before the push. pusher ( Actor! ) The actor who pushed. repository ( Repository! ) The repository that was pushed to. Ref Object Represents a Git reference. Ref Implements Node Fields for Ref Name Description associatedPullRequests ( PullRequestConnection! ) A list of pull requests with this ref as the head ref.
Arguments for associatedPullRequests after ( String ) Returns the elements in the list that come after the specified cursor. baseRefName ( String ) The base ref name to filter the pull requests by. before ( String ) Returns the elements in the list that come before the specified cursor. first ( Int ) Returns the first n elements from the list. headRefName ( String ) The head ref name to filter the pull requests by. labels ( [String!] ) A list of label names to filter the pull requests by. last ( Int ) Returns the last n elements from the list. orderBy ( IssueOrder ) Ordering options for pull requests returned from the connection. states ( [PullRequestState!] ) A list of states to filter the pull requests by. branchProtectionRule ( BranchProtectionRule ) Branch protection rules for this ref. compare ( Comparison ) Compares the current ref as a base ref to another head ref, if the comparison can be made.
Arguments for compare headRef ( String! ) The head ref to compare against. id ( ID! ) The Node ID of the Ref object. name ( String! ) The ref name. prefix ( String! ) The ref's prefix, such as refs/heads/ or refs/tags/ . refUpdateRule ( RefUpdateRule ) Branch protection rules that are viewable by non-admins. repository ( Repository! ) The repository the ref belongs to. rules ( RepositoryRuleConnection ) A list of rules from active Repository and Organization rulesets that apply to this ref.
Arguments for rules after ( String ) Returns the elements in the list that come after the specified cursor. before ( String ) Returns the elements in the list that come before the specified cursor. first ( Int ) Returns the first n elements from the list. last ( Int ) Returns the last n elements from the list. orderBy ( RepositoryRuleOrder ) Ordering options for repository rules. The default value is {field: UPDATED_AT, direction: DESC} . target ( GitObject ) The object the ref points to.
Returns null when object does not exist. RefConnection Object The connection type for Ref. Fields for RefConnection Name Description edges ( [RefEdge] ) A list of edges. nodes ( [Ref] ) A list of nodes. pageInfo ( PageInfo! ) Information to aid in pagination. totalCount ( Int! ) Identif
The rest of this page is on the live site.