如果使用用户名+密码的方式来 clone 远程仓库,如下形式:

git clone https://<user>:<password>@<gitserver>/<path>/<repo>.git

如果密码是纯文本,则可以正常工作,但如果密码具有感叹号等特殊字符,则需要使用 URL 编码。

!#$&()*+,/:;=?@[]
%21%23%24%26%27%28%29%2A%2B%2C%2F%3A%3B%3D%3F%40%5B%5D

使用凭据 myuser/password!github 存储库将如下所示:

$ git clone https://myuser:password%21@github.com/myuser/repo.git
Logo

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

更多推荐