
Answer-first summary for fast verification
Answer: Use Repos to create a new branch, commit all changes, and push changes to the remote Git repository.
## Explanation The correct answer is **E** because: 1. **Creating a new branch** is the standard Git workflow for developers who don't have write access to the main branch. This allows them to work independently without affecting the main codebase. 2. **Committing all changes to the new branch** ensures their work is saved locally. 3. **Pushing changes to the remote Git repository** makes their branch available to teammates for review and collaboration. 4. **This approach avoids overwriting teammates' work** because: - The developer works on an isolated branch - Changes can be reviewed via pull requests - The main branch remains protected - Teammates can see and review the changes before merging **Why other options are incorrect:** - **A**: Sending git diff logs is not a proper collaboration method and doesn't integrate changes into the repository. - **B**: Creating a fork is unnecessary when you already have access to clone the repository; creating a branch within the same repository is more efficient. - **C**: This option is unclear about what "branch that appeared as changes were pulled" means and doesn't specify creating a new branch for the developer's work. - **D**: Merging differences directly could overwrite teammates' work and doesn't follow the proper branch-based workflow. **Best Practice**: In Databricks Repos, when you don't have privileges to modify the main branch, you should: 1. Create a new branch from the main branch 2. Make your changes and commit them 3. Push the branch to the remote repository 4. Create a pull request for code review 5. Once approved, a maintainer with appropriate privileges can merge your changes.
Author: Keng Suppaseth
Ultimate access to all questions.
A developer has successfully configured their credentials for Databricks Repos and cloned a remote Git repository. They do not have privileges to make changes to the main branch, which is the only branch currently visible in their workspace.
Which approach allows this user to share their code updates without the risk of overwriting the work of their teammates?
A
Use Repos to checkout all changes and send the git diff log to the team.
B
Use Repos to create a fork of the remote repository, commit all changes, and make a pull request on the source repository.
C
Use Repos to pull changes from the remote Git repository; commit and push changes to a branch that appeared as changes were pulled.
D
Use Repos to merge all differences and make a pull request back to the remote repository.
E
Use Repos to create a new branch, commit all changes, and push changes to the remote Git repository.
No comments yet.