RepositoryExists
Checks if a repository exists at the specified path.Request
The repository to check for existence
Response
True if the repository exists, false otherwise
Example
RepositorySize
Returns the size of the repository in kilobytes.Request
The repository to measure
Response
Repository size in kilobytes
CreateRepository
Creates a new empty repository.Request
The repository to create
Branch name to set as the default branch. This will be treated as the branch name and not a fully qualified reference.
Example
OptimizeRepository
Performs all maintenance tasks to keep the repository in an efficient state. This includes cleaning up stale data, repacking objects, updating auxiliary caches like commit-graphs, and packing references.Request
The repository to optimize
Response
Empty response on success.Example
PruneUnreachableObjects
Prunes all objects which aren’t reachable from the repository’s current set of references. Objects must not have been accessed or modified in the last 30 minutes.You must call OptimizeRepository first to explode unreachable objects into loose objects, wait 30 minutes, then call PruneUnreachableObjects.
Request
The repository to prune
Response
Empty response on success.FetchRemote
Fetches references from a remote repository into the local repository.Request
Target repository to fetch into
Remote repository configuration
Force-update references if they have diverged
Skip fetching tags
Timeout in seconds for the fetch operation
Don’t prune remote references that no longer exist
Check whether any tags were modified
Response
True if tags were changed or cannot be determined. Only set if check_tags_changed was true.
FetchSourceBranch
Fetches a branch from a second (potentially remote) repository into the given repository.Request
Target repository to fetch into
Source repository to fetch from
Name of the branch in the source repository
Name of the reference to create in the target repository
Response
True if the source branch was successfully fetched, false if resolving or fetching failed
GetArchive
Generates an archive (tar, tar.gz, tar.bz2, or zip) from the repository at a specific commit.Request
The repository to archive
The commit to create the archive from
Prefix to add to all paths in the archive
Archive format: ZIP, TAR, TAR_GZ, or TAR_BZ2
Limit archive to a specific subdirectory
Patterns to exclude from the archive
If true and path refers to a subdirectory, elide that subdirectory from archive entries
Include LFS blob content in the archive
Response (Stream)
Chunk of archive data
CreateBundle
Creates a bundle from all refs in the repository.Request
The repository to bundle
Response (Stream)
Chunk of bundle data
CreateBundleFromRefList
Creates a bundle from a stream of ref patterns. Returns FailedPrecondition error if the bundle would be empty.Request (Stream)
The repository to bundle (first message only)
Patterns in the format accepted by git-rev-list(1). Patterns which don’t match any reference will be silently ignored.
Response (Stream)
Chunk of bundle data
FetchBundle
Fetches references from a bundle into the local repository. Refs will be mirrored with the refspec “+refs/:refs/” and refs that do not exist in the bundle will be removed.Request (Stream)
Repository to fetch into (first message only)
Bundle file stream data
Update HEAD if there is a HEAD reference listed in the bundle
Response
Empty response on success.CreateRepositoryFromBundle
Creates a new repository from a bundle file.Request (Stream)
The repository to create (first message only)
Bundle file stream data
Response
Empty response on success.CreateFork
Creates a fork of a repository.Request
The repository to create as a fork
The repository to fork from
Response
Empty response on success.CreateRepositoryFromURL
Creates a repository by cloning from a URL.Request
The repository to create
URL to clone from
Hostname of the remote repository. Use this when the URL hostname has been resolved to an IP address to prevent DNS rebinding.
HTTP authorization header for authentication
If true, creates a complete mirror clone which maps all remote references. If false (default), creates a bare clone with only branches and tags.
Response
Empty response on success.GetConfig
Reads the target repository’s gitconfig and streams its contents. Returns NotFound error if no gitconfig was found.Request
The repository to read config from
Response (Stream)
Chunk of gitconfig contents
ApplyGitattributes
Applies gitattributes from a specific revision to the repository.Request
The repository to apply gitattributes to
The revision containing the .gitattributes file
Response
Empty response on success.Fsck
Runs git fsck to check the repository for corruption.Request
The repository to check
Response
Error message if fsck found issues, empty if repository is healthy
WriteRef
Writes a reference to point to a specific revision.Request
The repository to write the ref in
The reference name to write
The revision the ref should point to
Expected old revision for atomic updates
Force update even if it’s not a fast-forward
Response
Empty response on success.FindMergeBase
Finds the merge base commit between multiple revisions.Request
The repository to search in
The revisions to find the merge base for (supports more than 2 revisions)
Response
The merge base commit ID, empty if no merge base found
HasLocalBranches
Checks if the repository has any local branches.Request
The repository to check
Response
True if the repository has local branches
FindLicense
Detects the license of the repository.Request
The repository to analyze
Response
Short name of the detected license (e.g., “MIT”, “Apache-2.0”)
GetInfoAttributes
Retrieves the contents of the repository’s info/attributes file.Request
The repository to read from
Response (Stream)
Chunk of attributes file content
CalculateChecksum
Calculates a checksum of the repository’s content.Request
The repository to checksum
Response
The calculated checksum
GetSnapshot
Creates a snapshot of the repository as a tar archive.Request
The repository to snapshot
Response (Stream)
Chunk of snapshot data
CreateRepositoryFromSnapshot
Creates a repository from a remote snapshot URL.Request
The repository to create
URL of the snapshot
Authentication credentials
Hostname of the remote snapshot. Use this when the URL hostname has been resolved to an IP address to prevent DNS rebinding.
Response
Empty response on success.GetRawChanges
Returns the raw changes between two revisions.Request
The repository to analyze
Starting revision
Ending revision
Response (Stream)
Array of raw changes between revisions
Object ID of the blob
Size of the blob
Type of operation: ADDED, COPIED, DELETED, MODIFIED, RENAMED, TYPE_CHANGED
Old file mode
New file mode
New path of the file
Old path of the file
SearchFilesByName
Searches for files by name pattern.Request
The repository to search in
Search query pattern
Reference to search at
Regular expression to filter results (max 1000 bytes)
Response (Stream)
Array of matching file paths
SearchFilesByContent
Searches for files by content pattern.Request
The repository to search in
Search query pattern
Reference to search at
Enable chunked response mode
Response (Stream)
Array of matching content
Raw match data in chunked mode
Indicates end of a match in chunked mode
RestoreCustomHooks
Restores custom hooks to the repository from a tar archive.Request (Stream)
The repository to restore hooks to (first message only)
Tar archive data containing hooks
Response
Empty response on success.BackupCustomHooks
Backs up custom hooks from the repository as a tar archive.Request
The repository to backup hooks from
Response (Stream)
Chunk of tar archive data
GetObjectDirectorySize
Returns the size of the repository’s object directory in kilobytes.Request
The repository to measure
Response
Object directory size in kilobytes
RemoveRepository
Removes a repository by moving it to a temporary location before deletion.Request
The repository to remove
Response
Empty response on success.RenameRepository
Renames a repository to a new relative path.Request
The repository to rename
New relative path for the repository
Response
Empty response on success.ReplicateRepository
Replicates a repository from a source.Request
The target repository
The source repository to replicate from
Response
Empty response on success.SetFullPath
Writes the “gitlab.fullpath” configuration into the repository’s gitconfig for debugging purposes.Request
The repository to configure
The full path to write into the gitlab.fullpath config key