当git clone报以下错误时,说明git本地存储的用户信息失效
could not read Username for 'http://xxx.com': Device not configured
解决方案:
1、在git地址上添加用户名密码,修改后的git地址为
git clone http://用户名:密码@host:/path/to/repository
2、当clone的地址提示bad url或不识别时,需要注意用户名、密码中是否包含特殊字符
! # $ & ' ( ) * + , / : ; = ? @ [ ]
%21 %23 %24 %26 %27 %28 %29 %2A %2B %2C %2F %3A %3B %3D %3F %40 %5B %5D
3、修改以后的git地址变化如下
// 原始git地址
git clone http://abc@d:123456@host:/path/to/repository
// 编码后的git地址
git clone http://abc%40d:123456@host:/path/to/repository