好的,我们的组织在 azure devops 存储库中拥有代码。
我一直在尝试通过 Mac 上的 git 命令行、Mac 上的 SourceTree 和 Windows 上的 SourceTree 来克隆它,但没有成功。
我在 azure git web UI 中创建了一个 PAT。
在Mac上,如果我这样做:
$ git clone https://ourorg.visualstudio.com/CMS/_git/ourProj
Cloning into 'ourProj'...
Username for 'https://ourorg.visualstudio.com': xxx
Password for 'https://[email protected] /cdn-cgi/l/email-protection':
fatal: Authentication failed for 'https://ourorg.visualstudio.com/CMS/_git/ourProj/'
对于用户,我尝试了我的azure用户,我也尝试了PAT。
对于pass,我厌倦了我的azure pass,还有PAT。
这些选项都不起作用。
对于sourcetree,我也尝试过这些组合:PAT/PAT user/PAT user/pass 等,但没有成功。有什么建议么?
这是我用来创建 PAT 的页面:
https://learn.microsoft.com/en-us/azure/devops/organizations/accounts/use-personal-access-tokens-to-authenticate?view=azure-devops https://learn.microsoft.com/en-us/azure/devops/organizations/accounts/use-personal-access-tokens-to-authenticate?view=azure-devops
该文档说使用 PAT 作为用户并通过,但这根本行不通。
医生还说你可以这样做:
git clone https://anything:{yourPAT}@dev.azure.com/yourOrgName/yourProjectName/_git/yourRepoName
但这也行不通。
例如如果我这样做(感谢 jessejouwing 修复):
$ git clone https://asdf:{myPATgoesHERE}@dev.azure.com/ourorg/CMS/_git/ourProj
在 Windows 上我总是得到:
克隆到“ourProj”...
致命:身份验证失败 'https://dev.azure.com/ourorg/CMS/_git/ourProj/ https://dev.azure.com/ourorg/CMS/_git/ourProj/'
PAT 100% 正确。
不幸的是,“替代凭据”在我们的组织中被禁用,因此我们必须使用 PAT。 PAT 不起作用,所以我无法工作。