在使用 git clone http://10.0.13.2/project 时系统提示如下图所示错误

解决git clone over https 401 error
The requested URL returned error: 401(curl_result = 22, http_code = 401 ....)
从http_code = 401 可以看出是因为authorization的问题,虽然已经提示了输入username和password,但在多次获取时并未将之前录入的username和password保存下来。
解决办法有二:
一、在$HOME下创建 _netrc文件,在其中写入如下内容
  machine 10.0.13.2
  login your_username
  password your_password
二、在执行命令式直接提供username和password,如下
   将git clone http://10.0.13.2/project 替换成
   git clone http://username:password@10.0.13.2/project

 

参考资料:
http://stackoverflow.com/questions/5796171/git-clone-over-https-401-error-and-not-asking-for-username-or-password
http://stackoverflow.com/questions/4980912/username-and-password-in-https-url

相关文章:

  • 2021-06-14
  • 2022-12-23
  • 2021-07-26
  • 2021-04-07
  • 2022-12-23
  • 2022-02-24
  • 2021-07-30
  • 2021-05-12
猜你喜欢
  • 2021-08-04
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-01-24
  • 2021-10-23
  • 2021-06-16
相关资源
相似解决方案