ListCommits
Lists all commits reachable via a set of references by doing a graph walk. This deprecates FindAllCommits and FindCommits (except Follow is not yet supported).Request
The repository to search for commits
Set of revisions to walk. Accepts all notation as documented in gitrevisions(7) as well as the pseudo-revisions
--not and --all. Must not be empty.Pagination configuration. The page token is the last commit OID that was sent (full object ID).
Order for traversing commits: NONE (reverse chronological), TOPO, or DATE
List all commits in reverse order
Skip commits with more than this many parents. If set to 1, all merge commits will be omitted. 0 means no filtering.
Disable graph walking. Only commits immediately referenced by revisions will be returned.
Only follow the first-parent chain of commits
Only list commits more recent than this date
Only list commits older than this date
Only list commits whose author matches this regular expression
Response (Stream)
List of commits found
Example
ListAllCommits
Lists all commits present in the repository, including those not reachable by any reference.Request
The repository to search for commits
Pagination configuration. The page token is the last commit OID (full object ID).
Response (Stream)
List of commits found
FindCommit
Finds a single commit by revision.Request
The repository to search in
The revision to find (commit ID, branch, tag, etc.)
Include commit trailers in the response
Response
The commit found, or null if not found
Example
CommitIsAncestor
Checks if a commit is an ancestor of another commit.Request
The repository to check in
The potential ancestor commit ID
The potential descendant commit ID
Response
True if ancestor_id is an ancestor of child_id
Example
CountCommits
Counts commits matching specific criteria.Request
The repository to count commits in
Starting revision for counting
Only count commits after this date
Only count commits before this date
Only count commits that touch this path
Maximum number of commits to count
Count all commits (mutually exclusive with revision)
Only follow first-parent chain
Response
Number of commits found
CountDivergingCommits
Counts how many commits differ between two references.Request
The repository to analyze
Starting reference
Ending reference
Maximum count to return
Response
Number of commits unique to the ‘from’ reference
Number of commits unique to the ‘to’ reference
CommitStats
Retrieves statistics about a commit (additions and deletions).Request
The repository containing the commit
The commit revision
Response
The commit OID. Empty if not found.
Number of lines added
Number of lines deleted
TreeEntry
Retrieves a tree entry (file or directory) at a specific path and revision.Request
The repository to retrieve from
Commit ID or refname
Entry path relative to repository root
Maximum bytes to fetch. 0 means no limit. Remaining bytes are not sent if object is bigger.
Maximum allowed object size. Returns FailedPrecondition error if bigger. 0 means no limit.
Response (Stream)
COMMIT, BLOB, TREE, or TAG
SHA1 object ID
Size of the object in bytes
File mode (e.g., 0644)
Raw object contents (may span multiple messages)
GetTreeEntries
Retrieves tree entries from a specific path.Request
The repository to retrieve from
The revision to read from
Path to list entries from (empty for root)
List entries recursively
Sort order: DEFAULT or TREES_FIRST
Pagination configuration
Response (Stream)
Array of tree entries
Object ID this entry points to
Path relative to repository root
BLOB, TREE, or COMMIT (submodule)
File mode (e.g., 0644)
Cursor for next page
ListFiles
Lists all files in a repository at a specific revision.Request
The repository to list files from
The revision to list files at
Response (Stream)
Array of file paths
FindAllCommits
Finds all commits reachable from a specific revision.Request
The repository to search in
Starting revision. If nil, returns all commits reachable by any branch.
Maximum number of commits to return
Number of commits to skip
Sort order: NONE, TOPO, or DATE
Response (Stream)
Array of commits
FindCommits
Finds commits with various filtering options.Request
The repository to search in
Starting revision
Maximum number of commits to return
Number of commits to skip
Only include commits that touch these paths
Follow file renames
Skip merge commits
Disable graph walking
Only commits after this date
Only commits before this date
Search all references (mutually exclusive with revision)
Only follow first-parent chain
Filter by author pattern
Sort order: NONE or TOPO
Include commit trailers
Response (Stream)
Array of commits
CommitLanguages
Analyzes the programming languages used in a commit.Request
The repository to analyze
The commit revision to analyze
Response
Array of programming languages detected
Name of the programming language
Percentage share of this language (0.0 to 1.0)
Display color for this language
Number of files in this language
Total bytes of code in this language
RawBlame
Retrieves git blame information for a file.Request
The repository to blame from
The revision to blame at
The file path to blame
Comma-separated range of line numbers (e.g., “1,1000”). Optional - if not provided, the whole file will be blamed.
Response (Stream)
Raw blame data
LastCommitForPath
Finds the last commit that modified a specific path.Request
The repository to search in
The revision to search from
The path to find the last commit for
Use literal pathspec (deprecated)
Response
The last commit that modified the path, or null if not found
ListLastCommitsForTree
Lists the last commits for each entry in a tree.Request
The repository to search in
The revision to search from
The tree path (empty for root)
Maximum number of results
Number of results to skip
Response (Stream)
Array of commits for tree entries
The commit
The path this commit modified
CommitsByMessage
Finds commits by searching commit messages.Request
The repository to search in
Starting revision
Search query for commit messages
Number of results to skip
Maximum number of results
Only search commits that touch this path
Response (Stream)
Array of commits matching the query
ListCommitsByOid
Lists commits by their object IDs.Request
The repository to retrieve from
Array of commit object IDs
Response (Stream)
Array of commits found
ListCommitsByRefName
Lists commits by reference names.Request
The repository to retrieve from
Array of reference names
Response (Stream)
Array of commits with their reference names
The commit
The reference name
FilterShasWithSignatures
Filters a list of commit SHAs to only those with signatures.Request (Stream)
The repository to check
Array of commit SHAs to check
Response (Stream)
Array of SHAs that have signatures
GetCommitSignatures
Retrieves cryptographic signatures for commits.Request
The repository to retrieve from
Array of commit IDs
Response (Stream)
The commit ID. Only present for a new commit signature.
The cryptographic signature
The text that was signed
GetCommitMessages
Retrieves commit messages for multiple commits.Request
The repository to retrieve from
Array of commit IDs
Response (Stream)
The commit ID. Only present for a new commit message.
The commit message
CheckObjectsExist
Checks for the existence of revisions in a repository.Request (Stream)
The repository to check in
Array of revisions to check. Accepts all revisions as documented in gitrevisions(7).
Response (Stream)
Array of revision existence results
The revision name
Whether the revision exists