Anonymous
Not applicable
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-28-2023 10:55 AM
@Oliver Angelil :
To use Git CLI in Databricks, you need to first set up Git credentials and clone your Git repository into your Databricks workspace. Here are the steps:
- Generate a Personal Access Token (PAT) on Azure DevOps that has the required permissions to clone the repository. You can follow the instructions in this Microsoft documentation to create a PAT: https://docs.microsoft.com/en-us/azure/devops/organizations/accounts/use-personal-access-tokens-to-a...
- In your Databricks workspace, click on the "User Settings" icon in the sidebar and select "Git Integrations".
- Click "Add" and fill out the Git integration form. Provide the Git repository URL, your Git username, and the PAT generated in step 1.
- Once you have successfully connected to your Git repository, you can use the Git CLI in a Databricks notebook or in a Databricks cluster by running shell commands in a cell with the %sh magic command prefix. For example, to clone your Git repository into your Databricks workspace, run the following command in a cell:
%sh
git clone <repository-url>5) To reverse the commit and push the changes, you can run the following commands:
%sh
git reset --soft HEAD^
git commit -m "Revert changes"
git push origin <branch-name>Note that you need to replace <repository-url> with the actual URL of your Git repository, and <branch-name> with the name of your feature branch.