【问题标题】:At-sign symbol in password make problem when add username and password to git clone url将用户名和密码添加到 git clone url 时,密码中的 at-sign 符号会出现问题
【发布时间】:2020-07-04 16:32:59
【问题描述】:

我想通过添加用户名和密码来克隆 git 存储库,如下所示:

https://myUserName:myPassWord@myGitRepositoryAddress/myAuthentificationName/myRepository.git

但我的密码包含@(如123@asd),这会导致 git 存储库 url 出现问题,我收到如下错误:

https://123@myGitRepositoryAddress/myAuthentificationName/myRepository.git

首先将@ 视为分隔符。

【问题讨论】:

标签: git command-line


【解决方案1】:

为了在您的 URL 中使用 @ 符号,您必须使用 percent-encoding。 @ 的百分比代码是 %40。因此,如果您想使用用户名user 和密码123@asd 克隆您的仓库,您必须使用以下网址:

https://user:123%40asd@myGitRepositoryAddress/myAuthentificationName/myRepository.git

【讨论】:

    猜你喜欢
    • 2016-03-10
    • 2021-12-29
    • 2012-04-20
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-12-20
    • 1970-01-01
    • 2017-05-18
    相关资源
    最近更新 更多