Cannot clone git from Azure DevOps using PAT

后端 未结 8 1737
礼貌的吻别
礼貌的吻别 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:26

    I've experienced the same issue, and spent quite a while searching for a solution. I finally came across this post which contained a solution in the comments section by Martinius79.

    In short, it was required to pass the username and PAT, encoded as base64, through git http.extraheaders in order for it to authenticate.

    100% Credit to the original author, just including it here to assist others in locating it:

    Example: git -c http.extraheader="AUTHORIZATION: Basic TXlHaXRTeW5jVXNlcjo2bHFqNXJkcHEzdXBxZWVmd2o3bDduZXN5NTR3d3gxNHFobDVlanl5NTVkb2g0M3d4YzRh" clone https://tfs.address/tfs/Collection/Project/_git/RepoName

    Used basic token BASE64 encoded: TXlHaXRTeW5jVXNlcjo2bHFqNXJkcHEzdXBxZWVmd2o3bDduZXN5NTR3d3gxNHFobDVlanl5NTVkb2g0M3d4YzRh

    Basic Token BASE64 decoded: MyGitSyncUser:6lqj5rdpq3upqeefwj7l7nesy54wwx14qhl5ejyy55doh43wxc4a

    Token is constructed from : In this example: Fictional user name: MyGitSyncUser Used PAT: 6lqj5rdpq3upqeefwj7l7nesy54wwx14qhl5ejyy55doh43wxc4a

    I hope this helps!

提交回复
热议问题