Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Note
This information applies to Databricks CLI versions 0.205 and above. The Databricks CLI is in Public Preview.
Databricks CLI use is subject to the Databricks License and Databricks Privacy Notice, including any Usage Data provisions.
The repos
command group within the Databricks CLI allows you to manage your Git folders. See Git integration for Databricks Git folders.
databricks repos create
Create a repo in the workspace and links it to the remote Git repo specified. Note that repos created programmatically must be linked to a remote Git repo, unlike repos created in the browser.
databricks repos create URL [PROVIDER] [flags]
Arguments
URL
URL of the Git repository to be linked
PROVIDER
Git provider. This field is case-insensitive. The available Git providers are gitHub, bitbucketCloud, gitLab, azureDevOpsServices, gitHubEnterprise, bitbucketServer, gitLabEnterpriseEdition and awsCodeCommit
Options
--json JSON
The inline JSON string or the @path to the JSON file with the request body.
--path string
Desired path for the repo in the workspace
Examples
The following examples create a repository linked to GitHub:
databricks repos create https://github.com/username/my-repo.git gitHub --path /Repos/username/my-repo
databricks repos create https://github.com/username/my-repo.git --path /Users/username/my-repo
databricks repos delete
Delete the specified repo.
databricks repos delete REPO_ID_OR_PATH [flags]
Arguments
REPO_ID_OR_PATH
The ID for the corresponding repo to delete
Options
Examples
The following examples delete a repository by ID or path:
databricks repos delete 12345
databricks repos delete /Repos/username/my-repo
databricks repos get
Get the repo with the given repo ID.
databricks repos get REPO_ID_OR_PATH [flags]
Arguments
REPO_ID_OR_PATH
ID of the Git folder (repo) object in the workspace
Options
Examples
The following examples get information about a repository by ID or path:
databricks repos get 12345
databricks repos get /Repos/username/my-repo
databricks repos list
Get repos that the calling user has manage permissions on. Use next_page_token
to iterate through additional pages.
databricks repos list [flags]
Options
--next-page-token string
Token used to get the next page of results
--path-prefix string
Filters repos that have paths starting with the given path prefix
Examples
The following examples list repositories:
databricks repos list
databricks repos list --path-prefix /Repos/username
databricks repos update
Update a repo to a different branch or tag, or update it to the latest commit on the same branch.
databricks repos update REPO_ID_OR_PATH [flags]
Arguments
REPO_ID_OR_PATH
ID of the Git folder (repo) object in the workspace
Options
--branch string
Branch that the local version of the repo is checked out to
--json JSON
The inline JSON string or the @path to the JSON file with the request body.
--tag string
Tag that the local version of the repo is checked out to
Examples
The following examples update a repository to different branches or tags:
databricks repos update 12345 --branch main
databricks repos update /Repos/username/my-repo --branch develop
databricks repos update 12345 --tag v1.0.0
databricks repos get-permission-levels
Get repo permission levels.
databricks repos get-permission-levels REPO_ID [flags]
Arguments
REPO_ID
The repo for which to get or manage permissions
Options
Examples
The following example gets the available permission levels for a repository:
databricks repos get-permission-levels 12345
databricks repos get-permissions
Get the permissions of a repo. Repos can inherit permissions from their root object.
databricks repos get-permissions REPO_ID [flags]
Arguments
REPO_ID
The repo for which to get or manage permissions
Options
Examples
The following example gets the permissions for a repository:
databricks repos get-permissions 12345
databricks repos set-permissions
Set repo permissions. Sets permissions on an object, replacing existing permissions if they exist. Deletes all direct permissions if none are specified. Objects can inherit permissions from their root object.
databricks repos set-permissions REPO_ID [flags]
Arguments
REPO_ID
The repo for which to get or manage permissions
Options
--json JSON
The inline JSON string or the @path to the JSON file with the request body.
Examples
The following example sets permissions for a repository using JSON:
databricks repos set-permissions 12345 --json '{"access_control_list": [{"user_name": "someone@example.com", "permission_level": "CAN_MANAGE"}]}'
databricks repos update-permissions
Update the permissions on a repo. Repos can inherit permissions from their root object.
databricks repos update-permissions REPO_ID [flags]
Arguments
REPO_ID
The repo for which to get or manage permissions
Options
--json JSON
The inline JSON string or the @path to the JSON file with the request body.
Examples
The following example updates permissions for a repository using JSON:
databricks repos update-permissions 12345 --json '{"access_control_list": [{"user_name": "someone@example.com", "permission_level": "CAN_READ"}]}'
Global flags
--debug
Whether to enable debug logging.
-h
or --help
Display help for the Databricks CLI or the related command group or the related command.
--log-file
string
A string representing the file to write output logs to. If this flag is not specified then the default is to write output logs to stderr.
--log-format
format
The log format type, text
or json
. The default value is text
.
--log-level
string
A string representing the log format level. If not specified then the log format level is disabled.
-o, --output
type
The command output type, text
or json
. The default value is text
.
-p, --profile
string
The name of the profile in the ~/.databrickscfg
file to use to run the command. If this flag is not specified then if it exists, the profile named DEFAULT
is used.
--progress-format
format
The format to display progress logs: default
, append
, inplace
, or json
-t, --target
string
If applicable, the bundle target to use