Mutations
createCommitOnBranch
Appends a commit to the given branch as the authenticated user.
This mutation creates a commit whose parent is the HEAD of the provided
branch and also updates that branch to point to the new commit.
It can be thought of as similar to git commit.
Locating a Branch
Commits are appended to a branch of type Ref.
This must refer to a git branch (i.e. the fully qualified path must
begin with refs/heads/, although including this prefix is optional.
Callers may specify the branch to commit to either by its global node
ID or by passing both of repositoryNameWithOwner and refName. For
more details see the documentation for CommittableBranch.
Describing Changes
fileChanges are specified as a FilesChanges object describing
FileAdditions and FileDeletions.
Please see the documentation for FileChanges for more information on
how to use this argument to describe any set of file changes.
Authorship
Similar to the web commit interface, this mutation does not support specifying the author or committer of the commit and will not add support for this in the future.
A commit created by a successful execution of this mutation will be authored by the owner of the credential which authenticates the API request. The committer will be identical to that of commits authored using the web interface.
If you need full control over author and committer information, please use the Git Database REST API instead.
Commit Signing
Commits made using this mutation are automatically signed by GitHub if supported and will be marked as verified in the user interface.
Input fields for createCommitOnBranch
input(CreateCommitOnBranchInput!)
Return fields for createCommitOnBranch
| Name | Description |
|---|---|
| A unique identifier for the client performing the mutation. |
| The new commit. |
| The ref which has been updated to point to the new commit. |
Objects
Commit
Represents a Git commit.
Commit Implements
Fields for Commit
| Name | Description |
|---|---|
| An abbreviated version of the Git object ID. |
| The number of additions in this commit. |
| The merged Pull Request that introduced the commit to the repository. If the commit is not present in the default branch, additionally returns open Pull Requests associated with the commit. Arguments for
|
| Authorship details of the commit. |
| Check if the committer and the author match. |
| The datetime when this commit was authored. |
| The list of authors for this commit based on the git author and the Co-authored-by message trailer. The git author will always be first. |
| Fetches Arguments for
|
| We recommend using the Warning
|
| The number of changed files in this commit. If GitHub is unable to calculate
the number of changed files (for example due to a timeout), this will return
|
| The check suites associated with a commit. Arguments for
|
| Comments made on the commit. |
| The HTTP path for this Git object. |
| The HTTP URL for this Git object. |
| The datetime when this commit was committed. |
| Check if committed via GitHub web UI. |
| Committer details of the commit. |
| The number of deletions in this commit. |
| The deployments associated with a commit. Arguments for
|
| The tree entry representing the file located at the given path. Arguments for
|
| The linear commit history starting from (and including) this commit, in the same order as Arguments for
|
| The Node ID of the Commit object. |
| The Git commit message. |
| The Git commit message body. |
| The commit message body rendered to HTML. |
| The Git commit message headline. |