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

问题描述

我需要转义使用密码的@,因为它与主机混淆。

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

示例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.

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

当我只使用命令, 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.

推荐答案

我认为你正在寻找的是转义特殊字符@,你可以使用encode%40,的@。此链接可能有助于

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克隆与密码@的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-23 16:36