Cannot clone git from Azure DevOps using PAT

后端 未结 8 1734
礼貌的吻别
礼貌的吻别 2020-12-15 07:11

I cannot clone a simple repository from Azure DevOps. OS: Ubuntu 18.10

I do this:

  • Got to Azure DevOps
  • Click on the top right corner on my use
相关标签:
8条回答
  • 2020-12-15 07:44

    This official guide procedure worked for me, but with one important point. When base64-encoding, one must put attention to non-printable characters.

    The guide says:

    MY_PAT=yourPAT      # replace "yourPAT" with your actual PAT
    B64_PAT=$(printf ":$MY_PAT" | base64)
    git -c http.extraHeader="Authorization: Basic ${B64_PAT}" clone 
    https://dev.azure.com/yourOrgName/yourProjectName/_git/yourRepoName
    

    Using "echo" instead of "printf" would insert a newline char, changing the base64 string (probably would work also with "echo -n" but I haven't tried). Also, do not include the username, as per the snippet above.

    Used git 2.17.1 on Ubuntu 18.04.

    0 讨论(0)
  • 2020-12-15 07:51

    Try : First delete the git credentials from Credential manager. Try Generating a new personal access token to resolve this error

    Go to security ->Personal access token->Add Give Description, select All scopes, click Create Token.

    Copy the token and store it for later use. This token can now be used in place of password for the git user.

    0 讨论(0)
提交回复
热议问题