无法使用 PAT 从 Azure DevOps 克隆 git [英] Cannot clone git from Azure DevOps using PAT

查看:40
本文介绍了无法使用 PAT 从 Azure DevOps 克隆 git的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我无法从 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:

  • Pass the token in the form https://usename:token@myorganization.visualstudio.com/myproject/_git/myrepo/ I am really surprised people say this worked... for my git complains because believes the : means the port.
  • Tried to activate/deactivate credential manager of git * Tried on Windows and Ubuntu.
  • 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)

  • 尝试在 git 命令中使用 http.extraHeader,标题为

  • Tried to use the http.extraHeader in the git command with the header being

    Authorization: Bearer PAT

  • 尝试使用 VSCode 客户端.它自己生成了 PAT,但仍然无法进行身份验证和克隆.
  • 尝试使用 Rider VSTS 客户端.它自己生成了 PAT,但仍然无法进行身份验证和克隆.
  • 尝试使用适用于 Linux 的 git 凭证管理器.它提示代码,当我们在浏览器中进行身份验证时,它会成功生成 PAT.尽管如此,之后仍无法进行身份验证.
  • 知道为什么这不起作用吗?

    Any clue why this is not working?

    推荐答案

    我已经成功地像这样使用 PAT;

    I have had success using PAT like this;

    1. 复制您的存储库的克隆 URL,例如git clone https://.visualstudio.com//_git/
    2. 复制 PAT 后,将其用作;

    git clone https://@.visualstudio.com//_git/

    不需要用户名或密码,因为 PAT 就足够了.

    No Username nor password should be required as the PAT should suffice.

    这篇关于无法使用 PAT 从 Azure DevOps 克隆 git的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

    查看全文
    相关文章
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆