Azure DevOps Services 版本控制Azure DevOps Services version control

Azure DevOps 是一系列服务,这些服务为 DevOps 的五个核心做法提供端到端解决方案,这五个核心做法是:规划和跟踪、开发、生成和测试、交付,以及监视和操作。Azure DevOps is a collection of services that provide an end-to-end solution for the five core practices of DevOps: planning and tracking, development, build and test, delivery, and monitoring and operations. 本文介绍了如何将 Azure DevOps 设置为 Git 提供程序。This article describes how to set Azure DevOps as your Git provider.

备注

有关名称从 Visual Studio Team Services 更改到 Azure DevOps 的信息,请参阅 Visual Studio Team Services 现在是 Azure DevOps ServicesFor information about the name change from Visual Studio Team Services to Azure DevOps, see Visual Studio Team Services is now Azure DevOps Services.

启用和禁用 Git 版本控制Enable and disable Git versioning

在默认情况下,版本控制处于启用状态。By default version control is enabled. 若要切换此设置,请参阅管理 Git 中的笔记本版本控制功能To toggle this setting, see Manage the ability to version notebooks in Git. 如果禁用了 Git 版本控制,则“用户设置”屏幕中不会有“Git 集成”选项卡 。If Git versioning is disabled, the Git Integration tab is not available in the User Settings screen.

入门Get started

在使用 Azure Active Directory (Azure AD) 进行身份验证时,会自动使用 Azure DevOps Services 完成身份验证。Authentication with Azure DevOps Services is done automatically when you authenticate using Azure Active Directory (Azure AD). Azure DevOps Services 组织必须链接到与 Databricks 相同的 Azure AD 租户。The Azure DevOps Services organization must be linked to the same Azure AD tenant as Databricks.

在 Azure Databricks 中,在“用户设置”页上将 Git 提供程序设置为 Azure DevOps Services:In Azure Databricks, set your Git provider to Azure DevOps Services on the User Settings page:

  1. 单击屏幕右上方的“用户”图标 帐户图标,然后选择“用户设置”。Click the User icon Account Icon at the top right of your screen and select User Settings.

    帐户设置Account settings

  2. 单击“Git 集成”选项卡。Click the Git Integration tab.

  3. 将提供程序更改为 Azure DevOps Services。Change your provider to Azure DevOps Services.

    Azure DevOps Services GitHub 提供程序Azure DevOps Services GitHub provider

笔记本集成Notebook integration

笔记本与 Azure DevOps Services 的集成和笔记本与 GitHub 的集成是完全相同的。Notebook integration with Azure DevOps Services is exactly like integration with GitHub. 请参阅使用笔记本修订版本,以详细了解如何使用 Git 来处理笔记本。See Work with notebook revisions to learn more about how to work with notebooks using Git.

提示

在“Git 首选项”中,使用 URL 方案 https://dev.azure.com/<org>/<project>/_git/<repo> 将 Azure DevOps 和 Azure Databricks 链接到同一个 Azure AD 租户。In Git Preferences, use the URL scheme https://dev.azure.com/<org>/<project>/_git/<repo> to link Azure DevOps and Azure Databricks to the same Azure AD tenant.

Git 首选项

如果你的 Azure DevOps 组织为 org.visualstudio.com,请在浏览器中打开 dev.azure.com 并导航到你的存储库。If your Azure DevOps organzation is org.visualstudio.com, open dev.azure.com in your browser and navigate to your repository. 从浏览器中复制 URL,并将该 URL 粘贴到“链接”字段中。Copy the URL from the browser and paste that URL in the Link field.

疑难解答Troubleshooting

Databricks UI 中的“保存”按钮已灰显。The Save button in the Databricks UI is grayed out.

Visual Studio Team Services 已重命名为 Azure DevOps ServicesVisual Studio Team Services renamed to Azure DevOps Services. https://<org>.visualstudio.com/<project>/_git/<repo> 格式的原始 URL 在 Azure Databricks 笔记本中不起作用。Original URLs in the format https://<org>.visualstudio.com/<project>/_git/<repo> do not work in Azure Databricks notebooks.

组织管理员可以从组织设置页自动更新 Azure DevOps Services 中的 URL。An organization administrator can automatically update the URLs in Azure DevOps Services from the organization settings page.

或者,你也可以手动创建要与 Azure DevOps Services 同步的 Azure Databricks 笔记本中使用的新 URL 格式。Alternately, you can manually create the new URL format used in Azure Databricks notebooks to sync with Azure DevOps Services. 在 Azure Databricks 笔记本中,在“Git 首选项”对话框中的“链接”字段中输入新 URL。In the Azure Databricks notebook, enter the new URL in the Link field in the Git Preferences dialog.

旧 URL 格式:Old URL format:

https://<org>.visualstudio.com/<project>/_git/<repo>

新 URL 格式:New URL format:

https://dev.azure.com/<org>/<project>/_git/<repo>