6

Here is my git url as reported by Azure TFS:

https://mycompany@dev.azure.com/mycompany/myproject/_git/myproject

Here is my clone command

git clone https://myusername:mypass@mycompany@dev.azure.com/mycompany/myproject/_git/myproject

However, I am unable to access the repository. The error is:

Could not resolve host: mycompany@dev.azure.com

Can someone please suggest how to overcome this? Regards.

Peter
  • 10,409
  • 14
  • 70
  • 136
  • Are you behind a firewall or do you have to route all traffic through a proxy? – Daniel Mann Feb 15 '19 at 16:09
  • You cannot pass 2 logins. It's either `myusername:mypass@dev.azure.com` or `mycompany:companypass@dev.azure.com` but not both. – phd Feb 15 '19 at 16:37
  • phd. Thank you for your hint. Turns out Azure generated url is somewhat incorrect. It should really be https://dev.azure.com/mycompany/xxx. – Peter Feb 15 '19 at 17:11
  • You could also install the latest version of git credential manager https://github.com/Microsoft/Git-Credential-Manager-for-Windows/releases/tag/v1.18.1 – nkoc001 May 08 '19 at 22:19

2 Answers2

5

This was from the hint in phd's comment. Turns out, Azure generated url is somewhat misleading. Instead of,

 https://mycompany@dev.azure.com/mycompany/myproject/_git/myproject

it should really be:

https://dev.azure.com/mycompany/myproject/_git/myproject

This way, the following would work:

https://myuser:mypass@dev.azure.com/mycompany/myproject/_git/myproject
Peter
  • 10,409
  • 14
  • 70
  • 136
  • @Peter, please accept your own answer. We now have a candidate duplicate: https://stackoverflow.com/questions/62570620/could-not-resolve-host-dev-azure-com-while-cloning-a-git-repository – Daemon Painter Jun 25 '20 at 09:26
2

maybe you dont have internet connection. you can check connection.

MahmutKarali
  • 190
  • 2
  • 7