Git克隆与密码@ [英] Git clone with password @

查看:145
本文介绍了Git克隆与密码@的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



示例1:
git克隆https:// user:p @ ssword @ github.com / user / repo.git



当我运行上面的例子,它是因为密码是@他明白下一个参数是主机。尝试使用\或您可以使用之间的URL,但不是。



示例2:
(echo user; echo p @ ssword)| git clone https://github.com/usuario/repo.git



当我只使用命令时, git clone https://github.com/usuario/repo.git 他询问用户和密码,所以我使用上面的命令,这与我用来更改root密码一样

解决方案

我想你正在寻找的是逃避特殊字符@,您可以使用编码%40的@。此链接可能有助于 git代理密码中的Escape @角色


I need to escape the @ that use the password because it is confused with the host.

Example 1: git clone https://user:p@ssword@github.com/user/repo.git

When I run the above example, it's wrong, because as the password has @ he understands that the next parameter is the host. tried to escape with \ or you can use the url between "" but it was not.

Example 2: (echo user; echo p@ssword) | git clone https://github.com/usuario/repo.git

When I use only the command,git clone https://github.com/usuario/repo.git he asks the User and Password, so I used the above command, which is the same that I use to change the root password on a line only.

解决方案

I think what you are looking is to escape the special character @, which you can use encode %40 instead of @. This link might help Escape @ character in git proxy password

这篇关于Git克隆与密码@的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆