git clone 密码带有@等特殊字符
正常使用git clone 的方式git clone https://remote使用带用户名密码的方式(可以避免后续每次都要输入用户名密码)git clone https://[username]:[password]@/remote但有时会出现用户名或密码中含有像@这样的特殊符号,而不能被正常解析我们需要通过下面方式进行重新编码String c = URLEncoder.encode("@",
·
正常使用git clone 的方式
git clone https://remote
使用带用户名密码的方式(可以避免后续每次都要输入用户名密码)
git clone https://[username]:[password]@/remote
但有时会出现用户名或密码中含有像@这样的特殊符号,而不能被正常解析
我们需要通过下面方式进行重新编码
String c = URLEncoder.encode("@",“utf-8”);
System.out.println©;
console -> %40
所有这样就可以知道@在url中需要写成%40的形式
$ git clone https://myuser:password%21@github.com/myuser/repo.git
更多推荐
所有评论(0)