共用方式為


在 Team Explorer 中連線到專案

Team Explorer 會將 Visual Studio 2019 和更新版本連線到 Team Foundation 版本控制 (TFVC) 存放庫,以及裝載於 Azure DevOps Services 或內部部署 Azure DevOps Server (之前稱為 Team Foundation Server (TFS)) 的專案。 您可以管理原始程式碼、工作項目和組建。

重要

隨著 Visual Studio 2019 16.8 版發行,Git 版本控制體驗會是預設值。 如果您想要深入了解它與 Team Explorer 的比較方式,請參閱 Git 和 Team Explorer 頁面的並存比較

不過,如果您想要繼續在 Visual Studio 2019 中使用 Team Explorer,請移至 [工具]>[選項]>[環境]>[預覽功能],然後切換 [新增 Git 使用者體驗] 核取方塊。 (Visual Studio 2022 及更新版本中未提供此選項。)

使用 Team Explorer 連線至專案的方式取決於您所使用的 Visual Studio 2019 版本。

在 Visual Studio 2019 16.8 版和更新版本中

  1. 開啟 Visual Studio 2019。

  2. 在 [開始] 視窗上,選取 [複製存放庫]

    Screenshot of the Clone a Repository dialog in Visual Studio 2019 version 16.8 and later, for Azure DevOps

  3. 在 [瀏覽存放庫] 區段中,選取 [Azure DevOps]

    Screenshot of the 'Browse a repository' section of the The 'Connect to a Project' dialog box in Visual Studio 2019 version 16.8 and and later

  4. 如果您看到登入視窗,請登入您的帳戶。

  5. 在 [連線到專案] 對話方塊中,選擇您想要連線的存放庫,然後選取 [複製]

    Screenshot of the 'Connect to a Project' dialog box that's generated from Visual Studio 2019 version 16.8 and later

    提示

    如果您沒有看到預先填入的清單,其中列出要連線的存放庫,請選取 [新增 Azure DevOps Server] 以輸入伺服器 URL。 (或者,您可能會看到「找不到伺服器」提示,其中包含新增現有 Azure DevOps Server 或建立 Azure DevOps 帳戶的連結。)

    接下來,Visual Studio 會開啟顯示資料夾和檔案的 [方案總管]

  6. 選取 [Team Explorer] 索引標籤以檢視 Azure DevOps 動作。

    Screenshot of the 'Team Explorer' dialog box that's generated from Visual Studio 2019 version 16.8 and later

在 Visual Studio 2019 16.7 版及較早版本中

  1. 開啟 Visual Studio 2019。

  2. 在 [開始] 視窗上,選取 [複製或簽出程式碼]

    Screenshot of the 'Create a new project' window in Visual Studio 2019 version 16.7 and earlier

  3. 在 [瀏覽存放庫] 區段中,選取 [Azure DevOps]

    Screenshot of the 'Clone or check out code' window with the 'Browse a repository' section that lists Azure DevOps in Visual Studio 2019 version 16.7 and earlier

    如果您看到登入視窗,請登入您的帳戶。

  4. 在 [連線到專案] 對話方塊中,選擇您想要連線的存放庫,然後選取 [複製]

    Screenshot of the 'Connect to a Project' dialog box that's generated from Visual Studio 2019 version 16.7 and earlier

    注意

    您在清單方塊中看到的內容,取決於您有權存取的 Azure DevOps 存放庫。

    Visual Studio 會開啟 [Team Explorer],並在複製完成時顯示通知。

    Screenshot of the Team Explorer window in Visual Studio 2019 version 16.7 and earlier, after clone is complete

  5. 若要檢視您的資料夾和檔案,請選取 [顯示資料夾檢視] 連結。

    Screenshot of the Solutions section of the Team Explorer window in Visual Studio 2019 version 16.7 and earlier, after clone is complete

    Visual Studio 會開啟 [方案總管]

  6. 選擇 [解決方案與資料夾] 連結,搜尋要開啟的解決方案檔案 (具體來說,就是 .sln 檔案)。

    Screenshot of the 'Solutions and Folders' notification from Team Explorer in Visual Studio 2019 version 16.7 and earlier

    如果您的存放庫中沒有解決方案檔案,則會顯示「找不到解決方案」的訊息。 不過,您可以從資料夾功能表中按兩下任一檔案,以便在 Visual Studio 程式碼編輯器中開啟該檔案。

探索下列資源以繼續學習: