expectedHeadSha),
repo.createCommit().send() throws a RefUpdateError containing the status, reason, and ref
details.
Builder Methods
Attach bytes, async iterables, readable streams, or buffers.
Add UTF-8 text files.
Remove files or folders.
Finalize the commit and receive metadata about the new commit.
Options
Branch name that will receive the commit (for example
main).The commit message.
Provide
name and email for the commit author.Commit SHA that must match the remote tip; omit to fast-forward unconditionally.
Mirrors the
base_branch metadata field. Point to an existing branch whose tip should seed targetBranch if it does not exist. When bootstrapping a new branch, omit expectedHeadSha so the service copies from baseBranch; if both fields are provided and the branch already exists, the expectedHeadSha guard still applies.Store the branch under the
refs/namespaces/ephemeral/... namespace. When enabled, the commit is kept out of the primary Git remotes (for example, GitHub) but remains available through storage APIs.Use alongside
baseBranch when the seed branch also lives in the ephemeral namespace. Requires baseBranch to be set.Provide
name and email. If omitted, the author identity is reused.Abort an in-flight upload with
AbortController.Deprecated. Fully qualified ref (for example
refs/heads/main). Prefer targetBranch.Response
The SHA of the created commit
The SHA of the commit’s tree object
The branch that received the commit
Size of the uploaded pack in bytes
Number of blobs in the commit
Contains
branch, oldSha/old_sha, and newSha/new_shaStreaming Large Files
Use streams or async generators to upload large files without loading them into memory:Response
Thesend() method returns the following: