Get Active Git Branch Stay organized with collections Save and categorize content based on your preferences.
Version 4.0.26.2 (latest)
Get the Current Git Branch
Returns the git branch currently checked out in the given project repository
Request
GET/projects/{project_id}/git_branch
Datatype
Description
Request
HTTP Request
path
HTTP Path
Expand HTTP Path definition...
project_id
string
Project Id
Response
200: Git Branch
Datatype
Description
(object)
can
lock
object
Operations the current user is able to perform on this object
name
string
The short name on the local. Updating `name` results in `git checkout`
remote
lock
string
The name of the remote
remote_name
lock
string
The short name on the remote
error
lock
string
Name of error
message
lock
string
Message describing an error if present
owner_name
lock
string
Name of the owner of a personal branch
readonly
lock
boolean
Whether or not this branch is readonly
personal
lock
boolean
Whether or not this branch is a personal branch - readonly for all developers except the owner
is_local
lock
boolean
Whether or not a local ref exists for the branch
is_remote
lock
boolean
Whether or not a remote ref exists for the branch
is_production
lock
boolean
Whether or not this is the production branch
ahead_count
lock
integer
Number of commits the local branch is ahead of the remote
behind_count
lock
integer
Number of commits the local branch is behind the remote
commit_at
lock
integer
UNIX timestamp at which this branch was last committed.
ref
string
The resolved ref of this branch. Updating `ref` results in `git reset --hard``.
remote_ref
lock
string
The resolved ref of this branch remote.
400: Bad Request
Datatype
Description
(object)
message
lock
string
Error details
documentation_url
lock
string
Documentation link
404: Not Found
Datatype
Description
(object)
message
lock
string
Error details
documentation_url
lock
string
Documentation link
429: Too Many Requests
Datatype
Description
(object)
message
lock
string
Error details
documentation_url
lock
string
Documentation link
Examples
TypeScript
| https://github.com/looker-open-source/sdk-codegen/blob/main/examples/typescript/validateBranch.ts |
Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2026-02-09 UTC.