我有一個名為 Finanzdurchblick_Solution
在該解決方案中,我有一個主專案Finanzdurchblick和兩個參考專案Category_Helper_Project,CSV_Helper_Project以及一個額外的輔助本地專案String_Helper_Project
當我轉到該git Changes頁面時,我可以看到String_Helper_Project已選中。我可以暫存我所做的更改,String_Helper_Project但沒有未暫存的更改。我的主專案中的更改Finanzdurchblick不包括在內:

當我打開GitVisual Studio 頂部的下拉選單時,我可以看到我參考的專案的本地存盤庫,但我的主要專案Finanzdurchblick在那里不可見:

How can I add a local repository for my main project? And how do I switch to it in the Git Changes window? I am used to see a button "Add repository" when there is no repository yet. From there I could choose to push to a remote location or keep it locally.
I have also checked out the Create Git Repository page but could not find how to create one there. Interestingly, it references my String_Helper_Project in the path there:

I already checked the solution folders and could not find any .git folders.
Edit: in my Solution explorer, I found that String_Helper_Project is "checked" in, when I hover the Mouse over the small blue Lock beneath it.
uj5u.com熱心網友回復:
在 Git Changes 和其他區域啟用 Repo Switching:
Visual Studio 2022 在一個解決方案中添加了對多個 git 存盤庫的支持。
這仍然是一個預覽功能。要啟用該功能:
- 按
ControlQ打開搜索功能或使用 Visual Studio 頂部的搜索欄。 - 輸入
features并選擇搜索結果Environment > Preview Features

- 使能夠
Enable Multi Repo Support (requires Solution to restart)

- 重新啟動您的視覺作業室
現在您應該能夠在Git ExplorerGit 分支資源管理器中的存盤庫之間切換:

添加新的存盤庫
為了添加新的存盤庫,請通過檔案選單:
File> New>Repository
在那里您將找到添加新(本地)存盤庫的選項。

確保為您的專案選擇正確的路徑。
這還將生成使用外部應用程式創建存盤庫時不包含的 gitignore 檔案。
轉載請註明出處,本文鏈接:https://www.uj5u.com/caozuo/416521.html
標籤:
