【问题标题】:How to escape '@' (at) symbol when pulling git repository on Linux shell在 Linux shell 上拉 git 存储库时如何转义“@”(at)符号
【发布时间】:2016-06-01 18:06:29
【问题描述】:

我正在尝试从命令行提取一个 git 存储库,在命令中指定用户名和密码,如下所示:

git pull https://username:password@myrepo.kilnhg.com/.../myRepo.git

问题是我的用户名是电子邮件,所以显然字符'@'需要转义,如果没有,我会收到消息:

fatal: repository 'https://username:password@myrepo.kilnhg.com/.../myRepo.git/' not found

有人遇到同样的问题并解决了吗?

【问题讨论】:

  • 我不认为@symbol 是问题.. 寻找你
  • 尝试将其替换为 %40
  • @FirebladeDan 这就是我的想法,但是指定另一个用户名(没有'@')我得到一个不同的错误:fatal: Authentication failed for ...
  • @VonC 适用于 %40,谢谢!也许您想将其发布为答案。

标签: linux git shell


【解决方案1】:

通常,您可以尝试使用percent encode 您的密码,将@ 替换为%40

git pull https://username:<yourPasswordwith%40>@myrepo.kilnhg.com/.../myRepo.git
                                           ^^^

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2014-02-12
    • 1970-01-01
    • 2016-08-15
    • 2023-04-02
    • 2016-03-31
    • 1970-01-01
    • 1970-01-01
    • 2011-10-31
    相关资源
    最近更新 更多