- HTTP request
 - Path parameters
 - Query parameters
 - Request body
 - Response body
 - Authorization scopes
 - IAM Permissions
 - Try it!
 
Fetches Git ahead/behind against a remote branch.
HTTP request
GET https://dataform.googleapis.com/v1beta1/{name=projects/*/locations/*/repositories/*/workspaces/*}:fetchGitAheadBehind
The URL uses gRPC Transcoding syntax.
Path parameters
| Parameters | |
|---|---|
name | 
                
                   
 Required. The workspace's name. Authorization requires the following IAM permission on the specified resource  
  | 
              
Query parameters
| Parameters | |
|---|---|
remoteBranch | 
                
                   
 Optional. The name of the branch in the Git remote against which this workspace should be compared. If left unset, the repository's default branch name will be used.  | 
              
Request body
The request body must be empty.
Response body
workspaces.fetchGitAheadBehind response message.
If successful, the response body contains data with the following structure:
| JSON representation | 
|---|
{ "commitsAhead": integer, "commitsBehind": integer }  | 
                  
| Fields | |
|---|---|
commitsAhead | 
                    
                       
 The number of commits in the remote branch that are not in the workspace.  | 
                  
commitsBehind | 
                    
                       
 The number of commits in the workspace that are not in the remote branch.  | 
                  
Authorization scopes
Requires one of the following OAuth scopes:
https://www.googleapis.com/auth/cloud-platformhttps://www.googleapis.com/auth/bigquery
For more information, see the Authentication Overview.
IAM Permissions
Requires the following IAM permission on the name resource:
dataform.workspaces.fetchGitAheadBehind
For more information, see the IAM documentation.