SourceTree 無法對Github內的Organization Private Repositories執行指令

SourceTree 無法對Github內的Organization Private Repositories執行指令

今天要嘗試用SourceTree對Github上Organization的Private專案執行Clone,發生一連串小問題

首先從Remote repositories 用OAuth方式增加Github帳號

在用Remote Account同步時,第一次點選Show Organization時一片空白,確認問題後才發現,第一次同步Organization帳號時需要在Github 的Setting > Apllications > Authorized OAuth Apps 中開啟Sourcetree

尋找Organization access 並按下Grant

完成後回到SourceTree (可能需要重開)在按一下Refresh 就可看到Organization 的Repositories

本以為這樣就可順利Clone專案,沒想到在Clone Private 專案時卻失敗,跳出的訊息是 Logon failed, use ctrl+c to cancel basic credential prompt 但神奇的是Public專案卻不會有此問題

Google了一下 是因為新版的GIT已經棄用了密碼認證,需要更新Git,可透過指令或安裝檔進行,我的電腦是Windows,指令:git update-git-for-windows

更新完成後再次嘗試Clone Private 專案時會跳出CredentialHelperSelector訊息

Windows版的預設是 manager ,如果選擇 manager則還是會出現一樣的錯住,需要選擇manager-core 就完成啦!!

至於為何要設定為manager-core,我自己爬文下來的理解(有誤請指正~) 是因為微軟收購Github後整併,設計了manager-core 廢除了密碼登入並簡化驗證,提升了整體的使用體驗也增加了安全性,詳細的內容可參考下列文章 :

7.14 Git 工具 - Credential Storage

Git憑證儲存

Use Git Credential Manager Core to authenticate to Azure Repos

tags: DevTools SourceTree Git GitHub

留言板
歷史留言

標籤