【问题标题】:cloning from github when password has ! in it [duplicate]有密码时从 github 克隆!在里面[重复]
【发布时间】:2013-05-09 19:17:30
【问题描述】:

我有一个密码!在其中以及当我尝试使用以下语法从 git 克隆存储库时:

  git clone https://username:password!@github.com/org/repository.git

我收到此错误:

 bash: !@github.com/org/repository.git: event not found

如何在不更改密码的情况下修复它?

我在 Linux 中。我在windows中使用过这个没有任何问题。

【问题讨论】:

    标签: linux git bash


    【解决方案1】:

    只需反斜杠感叹号。它在bash(历史扩展)中有特殊的含义。

    git clone https://username:password\!@github.com/org/repository.git
    

    您也可以将其包装成单引号('):

    git clone 'https://username:password!@github.com/org/repository.git'
    

    【讨论】:

    • 在尝试转义 !使用反斜杠但用单引号括起来
    猜你喜欢
    • 1970-01-01
    • 2021-10-23
    • 2012-08-25
    • 2017-12-19
    • 2020-12-01
    • 2013-04-09
    • 1970-01-01
    • 2015-01-05
    • 1970-01-01
    相关资源
    最近更新 更多