问题描述
我无法从 Azure DevOps 克隆一个简单的存储库.操作系统:Ubuntu 18.10
I cannot clone a simple repository from Azure DevOps.OS: Ubuntu 18.10
我这样做:
- 进入 Azure DevOps
- 点击右上角的我的用户名
- 转到安全选项卡
- 创建一个包含所有范围的 PAT(确保没有范围问题)
- 将 PAT 复制到剪贴板
- 将 PAT 粘贴到其他地方以确认 PAT 已被正确复制(我知道...不安全,但这超出了本问题的范围)
- 进入我的控制台
- 问题:
git clone https://myorganization.visualstudio.com/myproject/_git/myrepo/
- 我输入用户名和密码(PAT)
我不断收到来自 Git 的消息:fatal:https://myorganization.visualstudio.com/myproject/_git/myrepo/"的身份验证失败
I keep getting this message from Git:fatal: Authentication failed for 'https://myorganization.visualstudio.com/myproject/_git/myrepo/'
我正在阅读其他人的解决方案,但没有一个对我有用.我也试过这个:
I was reading the solutions of other people but none worked for me.I also tried this:
- 以 https://usename:token@myorganization 的形式传递令牌.visualstudio.com/myproject/_git/myrepo/ 我真的很惊讶人们说这有效......因为我的 git 抱怨因为相信 : 意味着端口.
- 试图激活/停用 git 的凭证管理器 * 在 Windows 和乌班图.
- 尝试激活和停用简单凭据.
- 尝试使用简单的凭据,即用户名 + 密码.
- 试图将我的用户名放在 https://username@....
- 尝试使用 SSH
- 尝试在 git 命令中使用 http.extraHeader,标题为
- Pass the token in the form https://usename:[email protected]/myproject/_git/myrepo/ I am really surprised people say this worked... for my git complainsbecause believes the : means the port.
- Tried toactivate/deactivate credential manager of git * Tried on Windows andUbuntu.
- Tried to activate and deactivate the simple credentials.
- Tried with the simple credentials, i.e. username + password.
- Tried to put my user name in https://username@....
- Tried to use SSH
- Tried to use the http.extraHeader in the git command with the header being
Authorization: Basic Base64Encoded(uname:PAT)
Authorization: Bearer PAT
知道为什么这不起作用吗?
Any clue why this is not working?
推荐答案
我已经成功地像这样使用 PAT;
I have had success using PAT like this;
- 复制您的存储库的克隆 URL,例如
git clone https://.visualstudio.com//_git/
- 复制 PAT 后,将其用作;
git clone https://@.visualstudio.com//_git/
不需要用户名或密码,因为 PAT 就足够了.
No Username nor password should be required as the PAT should suffice.
这篇关于无法使用 PAT 从 Azure DevOps 克隆 git的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!