Databricks Machine Learning Associate Question 20
Select 3You are working on a Databricks notebook stored in a Databricks Repo that is connected to an external Git provider (e.g., GitHub). After making changes to the notebook, you want to commit these changes back to the external Git repository. Which of the following steps must you perform to successfully commit your changes?
- A
Use the Databricks Repos UI to add a commit message and click 'Commit & Push'.
- B
Ensure that your branch in Databricks is up to date with the remote branch to avoid merge conflicts.
- C
Run the
%git commitcommand in a Databricks notebook to commit changes directly to the external Git provider. - D
Stage your changes manually using the external Git provider's CLI before committing through Databricks.
- E
Resolve any merge conflicts in the Databricks Repos UI if prompted before committing changes.
Show answer and explanation
Correct answers: A, B, E
Explanation
When working with Databricks Repos connected to an external Git provider, you must use the Databricks Repos UI to commit and push changes. It is essential to ensure your branch is up to date with the remote branch and resolve any merge conflicts if prompted. These steps help maintain consistency and avoid errors in collaboration workflows.
- A. Correct.
Correct: The Databricks Repos UI allows you to commit and push changes directly to the connected external Git repository. Adding a meaningful commit message is a required step.
- B. Correct.
Correct: Ensuring your branch is up to date with the remote branch helps avoid merge conflicts when pushing changes to the external Git repository.
- C. Incorrect.
Incorrect: The
%git commitcommand is not supported in Databricks notebooks. Git operations in Databricks Repos must be performed through the UI. - D. Incorrect.
Incorrect: Staging changes manually using the external Git provider's CLI is not necessary when using Databricks Repos, as changes are tracked automatically within the Repo.
- E. Correct.
Correct: Merge conflicts can occur when there are conflicting changes between your branch and the remote branch. These must be resolved in the Databricks Repos UI before committing changes.