/allowed endpoint.
UserCreateBranch
Creates a new branch in the repository.Request
The repository where the branch will be created
Name of the branch to create
User performing the operation
Commit SHA or reference to create the branch from
Response
The created branch object
Error returned by the pre-receive hook. Empty string if no error occurred
UserUpdateBranch
Updates an existing branch to point to a new commit.Request
The repository containing the branch
Name of the branch to update
User performing the operation
New commit SHA to update the branch to
Current commit SHA of the branch for safety check
Response
Error returned by the pre-receive hook. Empty string if no error occurred
UserDeleteBranch
Deletes a branch from the repository.Request
The repository containing the branch
Name of the branch to delete
User performing the operation
Response
Error returned by the pre-receive hook. Empty string if no error occurred
UserCreateTag
Creates a new tag in the repository. Creates either a lightweight or annotated tag based on whether a message is provided.Request
The repository in which the tag shall be created
Name of the tag to create
User as which the tag shall be created
Revision which the tag should point to
Message for the tag. If empty, a lightweight tag is created. Otherwise, an annotated tag is created
Optional timestamp to use for the created tag. Only used for annotated tags. Current time is used if not set
Response
The newly created tag
Denotes whether the tag already existed
Error message if updating the tag failed because of a pre-receive error
UserDeleteTag
Deletes a tag from the repository.Request
The repository containing the tag
Name of the tag to delete
User performing the operation
Response
Error returned by the pre-receive hook. Empty string if no error occurred
UserMergeToRef
Creates a merge commit and updates target_ref to point to that new commit. The first parent of the merge commit (the main line) is taken from first_parent_ref. The second parent is specified by its commit ID in source_sha. If target_ref already exists it will be overwritten.Request
The repository in which the merge shall be computed
User as which the merge commit shall be created
Object ID of the second parent of the computed merge
Fully qualified reference which should be updated with the computed merge commit
Message to use for the merge commit
Name of the reference to use as the first parent of the computed merge
Allow conflicts to occur. Conflict markers will be part of the merge commit
Optional timestamp to use for the merge commit. Current time is used if not set
Response
Object ID of the computed merge commit
UserMergeBranch
Tries to merge the given commit into the target branch. The merge commit is created with the given user as author/committer and the given message. This RPC requires confirmation to make any user-visible changes to the repository. Streaming RPC: This is a bidirectional streaming RPC. First request contains merge details, server responds with the merge commit ID. Second request withapply = true confirms the merge.
Request
The repository to compute the merge for (first message only)
User to compute the merge as. Used as author and committer (first message only)
Object ID of the commit to merge into the target branch (first message only)
Branch into which the commit shall be merged (first message only)
Message to use for the merge commit (first message only)
Optional timestamp for the merge commit. Current time is used if not set (first message only)
Must be set to true in the second message to confirm and apply the merge
Response
Merge commit ID that the branch will be updated to (first response)
Set if the merge has been applied to the branch (second response)
UserFFBranch
Tries to perform a fast-forward merge of the given branch to the given commit. If the merge is not a fast-forward merge, the request will fail. Returns an empty response if updating the reference fails due to a race condition.Request
The repository for which to perform the fast-forward merge
User to perform the fast-forward merge as. Used for authorization checks
Commit ID to update the branch to
Name of the branch to update (branch name only, not fully qualified reference)
Response
Details about the updated branch
Error returned by the pre-receive hook. Empty string if no error occurred
UserCherryPick
Tries to perform a cherry-pick of a given commit onto a branch.Request
The repository into which the cherry-pick shall be performed
User to perform the cherry-pick as. Used for authorization and as the committer
Commit to cherry-pick onto the given branch
Name of the branch onto which the cherry-pick shall be executed
Message to use for the cherry-picked commit
Used if branch_name doesn’t exist. Branch will be created from this branch
Repository containing start_branch_name if branch_name doesn’t exist
Compute the cherry-pick but don’t update the target branch
Optional timestamp for the cherry-picked commit’s committer date. Current time is used if not set
Response
Details about the updated branch
Error message if creation of the tree failed
Error message if updating the reference failed
Error message if the pre-receive hook failed
Error code if creation of the tree failed. Values: NONE (0), EMPTY (1), CONFLICT (2)
UserCommitFiles
Builds a commit from a stream of actions and updates the target branch to point to it. The first message must contain a header with commit details, followed by a variable number of actions. Streaming RPC: Send header first, then stream actions. Each action has a header followed by content if needed.Request
Must be sent as the first message in the stream
Target repository where to apply the commit
User performing the call
Name of the branch to point to the new commit
Message to use in the commit
Commit author’s name. User’s name is used if not provided
Commit author’s email. User’s email is used if not provided
Branch whose commit to use as parent. Takes priority over branch_name
Repository containing the parent commit. Uses repository if not specified
Force update the target branch to point to the new commit
SHA of commit to use as parent. Takes priority over start_branch_name and branch_name
Optional timestamp to use for the commit. Current time is used if not set
Action to build a commit. Multiple actions can be sent per stream
Action details. Must be sent before content
Type of action: CREATE (0), CREATE_DIR (1), UPDATE (2), MOVE (3), DELETE (4), CHMOD (5)
Path of the file or directory being modified
Used in MOVE action to specify the path of the file to move
Indicates the content is base64 encoded (RFC 4648). Only for CREATE and UPDATE actions
Create file with execute permissions. Only for CREATE and CHMOD actions
For MOVE actions that only change path, not content. Set to true instead of populating content
File content streamed in one or more messages. Only for CREATE and UPDATE actions
Response
Details of the commit and branch update
Error message for invalid actions (e.g., creating a file that already exists)
Error message if the pre-receive hook failed
UserRebaseConfirmable
Rebases the given remote branch onto a target branch. The remote branch may be part of another repository. This RPC requires confirmation to make any user-visible changes to the repository. Streaming RPC: First request contains rebase details, server responds with the rebase commit ID. Second request withapply = true confirms the rebase.
Request
Must be sent as the first message (first message only)
Repository in which the rebase will be computed and applied
User to compute the rebase as. Used as committer of rebased commits
Branch onto which the rebase shall happen
Expected object ID that branch currently points to. Safety guard against races
Repository containing the branch to rebase onto the local branch
Branch name to rebase onto the local branch
Options to pass to git hooks when updating the local branch
Optional timestamp for rebased commits as committer date. Current time is used if not set
Must be set to true in the second message to confirm the rebase
Response
Rebase commit ID that the branch will be updated to (first response)
Confirms that the rebase has been applied to the branch (second response)
Error message if the rebase failed due to hooks
Error message if git operations failed
UserRevert
Tries to perform a revert of a given commit onto a branch.Request
The repository in which the revert shall be applied
User to perform the revert as. Used for authorization and as author/committer
Commit to revert
Name of the branch onto which the reverted commit shall be committed
Message to use for the revert commit
Used if branch_name doesn’t exist. Branch will be created from this branch
Repository containing start_branch_name if branch_name doesn’t exist
Compute the revert but don’t update the target branch
Optional timestamp for the revert commit’s committer date. Current time is used if not set
Response
Details about the updated branch
Error message if creation of the tree failed
Error message if updating the reference failed
Error message if the pre-receive hook failed
Error code if creation of the tree failed. Values: NONE (0), EMPTY (1), CONFLICT (2)
UserSquash
Squashes a range of commits into a single commit. Returns the object ID of the newly created squash commit on success.Request
The repository into which the squashed commit shall be written
User for authorization checks
Object ID of the start commit of the range to squash. Must be an ancestor of end_sha
Object ID of the end commit of the range to squash
User to be used as the author of the squashed commit
Message to use for the squashed commit
Optional timestamp for the squashed commit as committer date. Current time is used if not set
Response
Object ID of the squashed commit
UserApplyPatch
Applies patches to a given branch. Streaming RPC: First message contains header with configuration, subsequent messages contain patch data.Request
Must be sent as the first message
Repository to which patches shall be applied
User for authentication
Branch onto which the patches shall be applied
Optional timestamp for the commits as committer date. Current time is used if not set
Patch data streamed in subsequent messages
Response
Information about the updated branch
UserUpdateSubmodule
Updates a submodule to point to a new commit.Request
The repository in which the submodule shall be updated
User for authorization and as author/committer of the resulting commit
Object ID the submodule shall be updated to
Branch to update (unqualified name, without refs/heads/ prefix)
Path to the submodule to update
Message for the update commit
Optional timestamp for the update commit as committer date. Current time is used if not set
Response
Information about the updated branch
Error message if the pre-receive hook rejects the update
Error message if committing the update fails