正常使用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

Logo

腾讯云面向开发者汇聚海量精品云计算使用和开发经验,营造开放的云计算技术生态圈。

更多推荐